http 대신 https로 컬을 사용하도록 업데이트

http 대신 https로 컬을 사용하도록 업데이트

실행하려고 할 때 문제가 발생했습니다.개발 스택pip다음 명령을 사용하여 얻으려고합니다.자세한 매개변수를 추가했습니다

sudo -H -E python /opt/stack/devstack/files/get-pip.py -c /opt/stack/devstack/tools/cap-pip.txt --verbose

나는 이 출력을 얻었고 영원히 멈춰 있다가 네 번 더 시도하고 종료됩니다.

Created temporary directory: /tmp/pip-ephem-wheel-cache-WNf2he
Created temporary directory: /tmp/pip-req-tracker-YNDzMb
Created requirements tracker '/tmp/pip-req-tracker-YNDzMb'
Created temporary directory: /tmp/pip-install-qbbm3e
Setting pip!=8,<10 (from -c /opt/stack/devstack/tools/cap-pip.txt (line 1)) extras to: ()
Collecting pip!=8,<10 (from -c /opt/stack/devstack/tools/cap-pip.txt (line 1))
  1 location(s) to search for versions of pip:
  * https://pypi.org/simple/pip/
  Getting page https://pypi.org/simple/pip/
  Looking up "https://pypi.org/simple/pip/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pypi.org:443

내 컴퓨터는 다음을 사용하는 프록시 뒤에 있습니다.바람직한 것의 리스트일부 도메인 이름을 허용하려면 이러한 도메인이 허용됩니다.

# python
.pypa.io
.python.org
.pypi.org
.pythonhosted.org

또한 우리는 우리의자신의 인증서

컬이 있는 페이지를 얻을 수 있지만 curl -v pypi.org:443이것은 장황한 모드로 얻은 출력입니다.

* Rebuilt URL to: www.pypi.org:443/
*   Trying X.X.X.X...
* Connected to X.X.X.X (X.X.X.X) port XXYY (#0)
> GET http://www.pypi.org:443/ HTTP/1.1
> Host: www.pypi.org:443
> User-Agent: curl/7.47.0
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 503 Service Unavailable
< Server: squid/3.5.12
< Mime-Version: 1.0
< Date: Fri, 24 Aug 2018 15:55:36 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 3601
< X-Squid-Error: ERR_CONNECT_FAIL 101
< Vary: Accept-Language
< Content-Language: en
< X-Cache: MISS from dns
< X-Cache-Lookup: MISS from dns:XXYY
< Via: 1.1 dns (squid/3.5.12)
< Connection: close
< 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
...
</body></html>
* Closing connection 0

하지만 openssl을 실행하면 아무것도 얻지 못합니다.sudo openssl s_client -connect pypi.org:443

또한 오징어 액세스 로그를 확인할 때 TCP_MISS를 볼 수 있습니다.

1535126136.880    137 X.X.X.X TCP_MISS/503 3966 GET http://www.pypi.org:443/ - HIER_DIRECT/2a04:4e42:2c::319 text/html

도움을 주시면 감사하겠습니다.

이 일이 나를 미치게 만들고 있어요.

감사합니다.

http 대신 https로 컬을 사용하도록 업데이트

명령을 실행할 때 curl -v https://pypi.org:443이것이 내가 얻는 출력입니다.

* Rebuilt URL to: https://pypi.org:443/
*   Trying X.X.X.X...
* Connected to X.X.X.X (X.X.X.X) port XXYY (#0)
* Establish HTTP proxy tunnel to pypi.org:443
> CONNECT pypi.org:443 HTTP/1.1
> Host: pypi.org:443
> User-Agent: curl/7.47.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 Connection established
< 
* Proxy replied OK to CONNECT request
* found 149 certificates in /etc/ssl/certs/ca-certificates.crt
* found 601 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / RSA_AES_128_GCM_SHA256
*    server certificate verification SKIPPED
*    server certificate status verification SKIPPED
*    common name: pypi.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #1
*    subject: CN=pypi.org
*    start date: Tue, 15 May 2018 17:28:09 GMT
*    expire date: Fri, 12 May 2028 17:28:09 GMT
*    issuer: ******** info about the certificate issuer *********
*    compression: NULL
* ALPN, server did not agree to a protocol
> GET / HTTP/1.1
> Host: pypi.org
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Security-Policy: base-uri 'self'; block-all-mixed-content; connect-src 'self' https://api.github.com/repos/ *.fastly-insights.com sentry.io https://2p66nmmycsj3.statuspage.io; default-src 'none'; font-src 'self' fonts.gstatic.com; form-action 'self'; frame-ancestors 'none'; frame-src 'none'; img-src 'self' https://warehouse-camo.cmh1.psfhosted.org/ www.google-analytics.com *.fastly-insights.com; script-src 'self' www.googletagmanager.com www.google-analytics.com *.fastly-insights.com https://cdn.ravenjs.com; style-src 'self' fonts.googleapis.com; worker-src *.fastly-insights.com
< Content-Type: text/html; charset=UTF-8
< ETag: "5fFqoiKHaa7+ibgDS4xg6Q"
< Referrer-Policy: origin-when-cross-origin
< Server: nginx/1.13.9
< Content-Length: 17391
< Accept-Ranges: bytes
< Date: Fri, 24 Aug 2018 16:32:00 GMT
< Age: 17
< X-Served-By: cache-iad2147-IAD
< X-Cache: HIT
< X-Cache-Hits: 1
< X-Timer: S1535128321.765578,VS0,VE1
< Vary: Accept-Encoding, Accept-Encoding
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Permitted-Cross-Domain-Policies: none
< X-Cache: MISS from dns
< X-Cache-Lookup: MISS from dns:3131
< Via: 1.1 dns (squid/3.5.12)
< Connection: close
< 
<!DOCTYPE html>
<html lang="en">
<head>
...
</body></html>
* Closing connection 0

그리고 이건 오징어 접속 로그예요

1535128320.770    105 129.6.112.80 TCP_MISS/200 18684 GET https://pypi.org/ - HIER_DIRECT/151.101.128.223 text/html

답변1

프록시를 사용해야 할 것 같지만 로 프록시를 설정하지 마세요 get-pip.py. 그것이 실패하는 이유입니다. 에 따르면문서 get-pip.py다음과 같은 방법으로 프록시를 제공해야 합니다.

python get-pip.py --proxy="http://[user:passwd@]proxy.server:port"

컬을 기본으로 사용하여 실험에서 얻은 자세한 출력을 다음과 같이 사용해야 합니다.

python get-pip.py --proxy="http://X.X.X.X:XXYY"

또는 지금까지 사용한 특정 명령줄을 사용하여 다음을 수행합니다.

sudo -H -E python /opt/stack/devstack/files/get-pip.py \
    --proxy="http://X.X.X.X:XXYY" \
    -c /opt/stack/devstack/tools/cap-pip.txt --verbose

관련 정보