首页 > 解决方案 > 将 https 与 curl 一起使用,但仍然出现“GET_SERVER_HELLO:unknown protocol”错误

问题描述

我正在尝试在 docker 实例中使用 curl 到达 https 端点。尽管我使用的是“https”,但我收到了一个错误,“error:140770FC:SSLroutines:SSL23_GET_SERVER_HELLO:unknown protocol”。我还需要做什么才能到达终点?这是痕迹...

root@my-instance:/app# curl -v https://localhost:3056/myusers/242
*   Trying ::1...
* TCP_NODELAY set
* connect to ::1 port 3056 failed: Connection refused
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3056 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

标签: sslcurlhttps

解决方案


推荐阅读