2017-09-11 3 views
0


프록시를 통해 원본 서버와 통신하는 pycurl 라이브러리를 사용하여 HTTP 클라이언트를 작성하려고합니다.
1. HTTP 클라이언트 - -pycurl 오류 : HTTPS 프록시에서 200 응답의 Transfer-Encoding

유량을 밑도는 기대> 프록시 : SSL 교환 ## SUCCESS
2. HTTP 클라이언트 -> 프록시 : - : TCP> 원본 서버 HTTP는 https://origin_server ## 성공
3. 프록시 CONNECT 연결 핸드 셰이크 ## SUCCESS
4. 프록시 -> HTTP 클라이언트 : 200 OK ## 응답은 수신되었지만 Transfer-Encoding 헤더가 설정되었습니다. 역 추적 (마지막으로 가장 최근 통화) :
파일 "pycurl_client.py", 라인 (20),
c.perform에서

import pycurl 
from StringIO import StringIO 

buffer = StringIO() 
c = pycurl.Curl() 
url = 'https://origin_server/index' 
proxy = 'https://local_proxy:8445' 

c.setopt(c.URL, url) 
c.setopt(c.PROXY, proxy) 

c.setopt(c.PROXY_SSLCERT, 'client.cer') 
c.setopt(c.PROXY_CAINFO, 'ca.pem') 
c.setopt(c.PROXY_SSLKEY, 'private.key') 
c.setopt(c.PROXY_SSL_VERIFYPEER, True) 
c.setopt(c.WRITEDATA, buffer) 
c.setopt(c.VERBOSE, True) 
c.setopt(c.TRANSFER_ENCODING, False) 

c.perform() 
c.close() 

오류가 수신 - 다음

클라이언트 코드()
pycurl.error (56 '전송 인코딩 200 답변')

'Transfer-Encoding'이 'chuncked'로 설정된 이유와 그 해결 방법에 대한 근본 원인에 대한 도움이 필요하십니까?

답변

0

문제는 libcurl 버전 7.53에서 발생했습니다. 그리고 libcurl 7.55로 업그레이드 할 때 문제가 해결되었습니다.