0

I'm getting following error when use the curl command to an internal server.

Successfully set certificate verify locations: *   CAfile: none   CApath: /etc/ssl/certs * 
TLSv1.3 (OUT), TLS handshake, Client hello (1): * error:1408F10B:SSL 
routines:ssl3_get_record:wrong version number * Closing connection 0 curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number root@0541b093747a:/#

I can't access internal artifactory server to download any python packages using pip. my Dockerfile contains following

RUN pip3 -vvv install -r /requirements.txt --trusted-host artifactory.int.net

I'm getting the following error when dockerfile try to download python package using pip inside.

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='artifactory.internal', port=443): Read timed out. (read timeout=15)",)': /artifactory/api/pypi/org.python.pypi/simple/filelock/

I'm running Docker desktop version 2.1.0.3, running on Mac catalina 10.15.7

I can access the artifactory outside the container

* Uses proxy env variable https_proxy == 'http://127.0.0.1:3128'
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 3128 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to artifactory.internal:443
> CONNECT artifactory.internal:443 HTTP/1.1
> Host: artifactory.internal:443
> User-Agent: curl/7.64.1
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate: CN=artifactory.internal
*  start date: Oct 30 00:00:00 2020 GMT
*  expire date: Oct 31 23:59:59 2021 GMT
*  subjectAltName: host "artifactory.internal" matched cert's "artifactory.internal"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: artifactory.internal
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.14.0
< Date: Fri, 29 Jan 2021 06:12:25 GMT
< Content-Type: text/html
< Content-Length: 161
< Location: https://artifactory.internal/artifactory/webapp/
< Connection: keep-alive
<
<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.14.0</center>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact
* Closing connection 0
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Markus
  • 369
  • 4
  • 16
  • What happens if you use `curl -v` to fetch something from artifactory from within the container? – superstator Jan 29 '21 at 04:20
  • same error, Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='artifactory.internal', port=443): Read timed out. (read timeout=15)",)': /artifactory/api/pypi/org.python.pypi/simple/filelock/ – Markus Jan 29 '21 at 04:22
  • Ok, what's the rest of the verbose output? And can you make the same exact `curl` call from outside the container? – superstator Jan 29 '21 at 04:26
  • @superstator updated the question section. pls have a look. thats the output from outside the container. – Markus Jan 29 '21 at 06:19
  • How does that output compare to the same command inside the container? – superstator Jan 29 '21 at 07:25
  • Is your container going through the proxy that's running on your machine? – Software Engineer Jan 29 '21 at 17:28
  • @SoftwareEngineer yes, its going via my proxy (cntlm) on local machine – Markus Jan 29 '21 at 23:24
  • @superstator only difference is inside the container it gives SSL version number wrong error. can't connect to https. – Markus Jan 29 '21 at 23:24
  • Have a look at this: https://stackoverflow.com/questions/50840101/curl-35-error1408f10bssl-routinesssl3-get-recordwrong-version-number – superstator Jan 30 '21 at 01:19

0 Answers0