0

I'm trying to reach an https endpoint using curl within a docker instance. Despite the fact I'm using "https", I'm getting an error, "error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol ". What else do I need to do to reach my endpoint? Here's the trace ...

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
Dave
  • 15,639
  • 133
  • 442
  • 830
  • 1
    This error mostly happen when a TLS client reaches something that is not a TLS server. So make sure that `localhost:3056` is indeed configured properly to act as an HTTPS server, not a pure HTTP one. If `http://localhost:3056/myusers/242` works then it proves it is only an HTTP endpoint, not an HTTPS one. So you need to configure your webserver. – Patrick Mevzek Oct 02 '19 at 17:41
  • Calling http://localhost:3056/myusers/242 automatically redirects to https://localhost:3056/myusers/242 (SO removes the protocols, but "http" is auto-redirected to "https"). – Dave Oct 02 '19 at 17:58
  • Use the reverse quote to put things in monospace font like I did in previous comment, and your URLs won't be turned in hyperlinks, and will be displayed as is, with their scheme. Anyway, you still have to troubleshoot the fact that your endpoint is probably just HTTP and not really HTTPS – Patrick Mevzek Oct 02 '19 at 18:00

0 Answers0