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) - 인증 용
감사 필요 당신이 제공 할 수있는 도움. 오류 메시지가 아주 명확하게 말한다
감사합니다, 에릭
내가 추가하고 싶은 한 가지는 TMG를 통과 할 필요가 없을 때 POST가 올바르게 작동한다는 것입니다. – eborisow