Search code examples
phpsslcurlcaddycaddyfile

I can't connect to a https site server by Caddy using curl


I am trying to contact a https site served by Caddy . I get an error when trying to get the content with CURL even with

CURLOPT_SSL_VERIFYPEER => false

There is a certain amount of worry about setting this to false anyway.


Solution

  • It turn out that by default Caddy will communication with a minimum of version of tls 1.1 whereas my host was using 1.0. If you add this to your caddyfile it should work if this is your issue.

    example.ie {
    tls {
       protocols tls1.0 tls1.2  #min max
     }
    log access.log
    errors err.log      
    proxy / http://myexample.com:3032
    
    }