У меня Ubuntu 18.04 server
позади coporate proxy
.
Я установил переменную окружения http_proxy
и https_proxy
.
Сервер работает Docker 19.03
, который такженастроен на использование http_proxy и https_poxy.
Если запустить docker run -it ubuntu:18.04
, внутри контейнера я могу сделать apt update
и apt install curl -y
Тогда я могу сделать что-то вроде curl www.google.com
.
Но он не работает с https
:
root@1b6abfb4ff90:/# curl -v -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0* Trying 10.30.88.14...
* TCP_NODELAY set
* Connected to xxx (10.30.88.14) port 8080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to raw.githubusercontent.com:443
> CONNECT raw.githubusercontent.com:443 HTTP/1.1
> Host: raw.githubusercontent.com:443
> User-Agent: curl/7.58.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connected
<
* 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/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* CONNECT phase completed!
* CONNECT phase completed!
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [91 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [2741 bytes data]
* TLSv1.2 (OUT), TLS alert, Server hello (2):
} [2 bytes data]
* SSL certificate problem: unable to get local issuer certificate
* stopped the pause stream!
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl не смог проверить легитимность сервера и поэтому не смог установить безопасное соединение с ним. Чтобы узнать больше об этой ситуации и о том, как ее исправить, посетите указанную выше веб-страницу.
Снаружи контейнера она работает нормально. Я также попытался сделать то же самое на другом сервере, который не находится за прокси-сервером и работает внутри контейнера.
Так что я полагаю, что это проблема конфигурации докера deamon. Или, может быть, я ошибаюсь ... Каково было бы решение?