2015-01-16 1 views
0

Microsoft TMG 및 httpclient 4.3.3을 통해 Salesforce의 web2lead 서블릿에 POST 요청을 보내는 데 문제가 있습니다. Ctnlm을 프록시로 사용하여 요청을 시도하면 TMG를 통해 프록시가 작동합니다. 또한 프록시를 통해 www.google.com에 GET 요청을 단순히 보내면 정상적으로 작동합니다. 여기 내가 사용하려고 해요 코드입니다 :Microsoft TMG Proxy + HTTP Post + SSL을 사용하는 ApacheHttpClient 4.3.3과 관련된 문제

2015년 1월 16일 17 : 33 : 31,158 [주] 디버그 org.apache 응답에서

HttpHost httpTargetHost = new HttpHost("www.salesforce.com", 443, "https"); 
HttpPost httpPost = new HttpPost("/servlet/servlet.WebToLead"); 

NTCredentials ntCreds = new NTCredentials("proxyUser", "proxyPassword", "workstation", "DOMAIN"); 

CredentialsProvider credsProvider = new BasicCredentialsProvider(); 
credsProvider.setCredentials(new AuthScope("proxyHost","proxyPort"), ntCreds); 
HttpClientBuilder clientBuilder = HttpClientBuilder.create(); 

clientBuilder.useSystemProperties(); 
clientBuilder.setProxy(new HttpHost("proxyHost","proxyPort")); 
clientBuilder.setDefaultCredentialsProvider(credsProvider); 
clientBuilder.setProxyAuthenticationStrategy(new ProxyAuthenticationStrategy()); 

CloseableHttpClient client = clientBuilder.build(); 
CloseableHttpResponse response = client.execute(httpTargetHost, httpPost); 

는,이납니다 .http.headers (LoggingManagedHttpClientConnection.java:113) - http-outgoing-0 < < HTTP/1.1 407 프록시 인증 필요 (Forefront TMG에서 요청을 수행하기 위해 권한 부여 필요 웹 프록시 필터에 대한 액세스가 거부되었습니다.) 2015-01 -16 17 : 33 : 31,158 [main] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - http-outgoing-0 < < 경유 : 1.1 PROXYHOST 20 15-01-16 17 : 33 : 31,159 [main] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - http-outgoing-0 < < 프록시 - 인증 : 협상 2015-01-16 17:33 : 31,159 [main] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - http-outgoing-0 < < 프록시 인증 : Kerberos 2015-01-16 17 : 33 : 31,159 [main] DEBUG org. http-outgoing-0 < < 프록시 인증 : NTLM 2015-01-16 17 : 33 : 31,160 [주] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116). java : 116) - http-outgoing-0 < < 연결 : 닫기 2015-01-16 17 : 33 : 31,160 [주] DEBUG org.apache.http.headers (로깅 프록시 연결 : 닫으십시오 2015-01-16 17 : 33 : 31,160 [주] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - http http-outgoing-0 < -outgoing하지 -0- < <에서 Pragma : 노 캐시 2015년 1월 16일 17 : 33 : 31160 [주] 디버그 org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - HTTP 출사 -0- < < 캐시 - 컨트롤 : no-cache 2015-01-16 17 : 33 : 31,161 [main] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - http-outgoing-0 < < 콘텐츠 유형 : text/html 2015-01-16 17 : 33 : 31,161 [main] DEBUG org.apache.http.headers (LoggingManagedHttpClientConnection.java:116) - http-outgoing-0 < < 콘텐츠 길이 : 2,699
2015년 1월 16일 17 : 33 : 31164 [주] 디버그 org.apache.http.impl.auth.HttpAuthenticator (HttpAuthenticator.java:77) - 인증 용

감사 필요 당신이 제공 할 수있는 도움. 오류 메시지가 아주 명확하게 말한다

감사합니다, 에릭

+0

내가 추가하고 싶은 한 가지는 TMG를 통과 할 필요가 없을 때 POST가 올바르게 작동한다는 것입니다. – eborisow

답변

0

:

은 Forefront TMG는 요청을 수행하려면 인증이 필요합니다. 웹 프록시 필터에 대한 액세스가 거부되었습니다.

제공하지 않는 승인이 필요합니다. 이 문제는 Apache HTTPClient에만 해당되지 않습니다. 필요한 권한 (및 자격 증명)이 무엇인지 Forefront TMG 설치 관리자에게 문의하십시오.그것은 당신이 시도한 인증의 종류 일 수도 있고 자격 증명 만 잘못되었거나 다른 종류의 승인이 필요할 수도 있습니다.

+0

분명히, SSL-GET이 아닌 요청에 대해 동일한 요청이 작동하는 이유가 궁금합니다. 언급했듯이, 그것은 TMG를 통해 잘 작동합니다. 아니면 POST + SSL 대 GET + SSL이 아닌 다른 인증 체계가 필요하다는 말입니까? – eborisow

+0

POST와 GET은 다른 사이트입니다. 프록시가 일부 사이트에 대한 액세스를 제한하도록 구성되었을 수 있습니다. 즉, 내부 사이트가 아닌 이러한 자격 증명을 사용하여 외부 사이트에 액세스 할 수 있습니다. 특히 Salesforce 설치의 경우 이는 의미가 있습니다. –

+0

이것은 회사 프록시입니다. 모든 승인되지 않은 인터넷 액세스를 차단합니다. 그래서, 여기서는 그렇지 않습니다. – eborisow

관련 문제