pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Trouble with pkgsrc



rvp%SDF.ORG@localhost (RVP) writes:

>This is the result of an unhandled `421 Misdirected Request' error.
>These days, most HTTP servers are hosted by CDNs and they expect
>an HTTP SNI (Server Name Indication) to be sent by the client when
>negotiating HTTPS requests.

>The fix for _this_ issue is pretty simple, but, it changes the
>libfetch API a bit.

This seems to work without API changes:

--- dist/libfetch/common.c      25 Jun 2011 20:27:01 -0000      1.2
+++ dist/libfetch/common.c      17 Jan 2023 14:17:18 -0000
@@ -452,6 +452,10 @@ fetch_ssl(conn_t *conn, int verbose)
                return (-1);
        }
        SSL_set_fd(conn->ssl, conn->sd);
+       if (!SSL_set_tlsext_host_name(conn->ssl, conn->cache_url->host)) {
+               fprintf(stderr, "SSL hostname setting failed\n"); 
+               return (-1);
+       }
        if (SSL_connect(conn->ssl) == -1){
                ERR_print_errors_fp(stderr);
                return (-1);




Home | Main Index | Thread Index | Old Index