Changeset 5eab9260


Ignore:
Timestamp:
2018-09-09T22:04:41Z (6 years ago)
Author:
Christopher Brannon <chris@…>
Branches:
master
Children:
67f4cfe
Parents:
37437f2
git-author:
Christopher Brannon <chris@…> (09-09-18 21:45:10)
git-committer:
Christopher Brannon <chris@…> (09-09-18 22:04:41)
Message:

SSL: correctly handle hostnames starting with a digit when SNI is needed.

I noticed that I was unable to connect to a host with bitlbee.
Tracking it down, I found that the problem was that the host needed SNI
but bitlbee wasn't trying to use it. The hostname started with a digit,
so bitlbee was assuming that it was an IP address.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/ssl_gnutls.c

    r37437f2 r5eab9260  
    323323        gnutls_set_default_priority(conn->session);
    324324        gnutls_credentials_set(conn->session, GNUTLS_CRD_CERTIFICATE, xcred);
    325         if (conn->hostname && !g_ascii_isdigit(conn->hostname[0])) {
     325        if (conn->hostname && !g_hostname_is_ip_address(conn->hostname)) {
    326326                gnutls_server_name_set(conn->session, GNUTLS_NAME_DNS,
    327327                                       conn->hostname, strlen(conn->hostname));
  • lib/ssl_openssl.c

    r37437f2 r5eab9260  
    167167        SSL_set_fd(conn->ssl, conn->fd);
    168168
    169         if (conn->hostname && !g_ascii_isdigit(conn->hostname[0])) {
     169        if (conn->hostname && !g_hostname_is_ip_address(conn->hostname)) {
    170170                SSL_set_tlsext_host_name(conn->ssl, conn->hostname);
    171171        }
Note: See TracChangeset for help on using the changeset viewer.