600 |
|
|
601 |
if (IRCItem.tls_hostname_verification) |
if (IRCItem.tls_hostname_verification) |
602 |
{ |
{ |
603 |
|
#ifndef LIBRESSL_VERSION_NUMBER |
604 |
SSL_set_hostflags(ssl_handle, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); |
SSL_set_hostflags(ssl_handle, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); |
605 |
|
|
606 |
if (SSL_set1_host(ssl_handle, IRCItem.server) == 0) |
if (SSL_set1_host(ssl_handle, IRCItem.server) == 0) |
607 |
|
#else |
608 |
|
X509_VERIFY_PARAM *param = SSL_get0_param(ssl_handle); |
609 |
|
X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); |
610 |
|
|
611 |
|
if (X509_VERIFY_PARAM_set1_host(param, IRCItem.server, 0) == 0) |
612 |
|
#endif |
613 |
{ |
{ |
614 |
log_printf("IRC -> unable to set expected DNS hostname"); |
log_printf("IRC -> unable to set expected DNS hostname"); |
615 |
/* OpenSSL is unable to verify the server hostname at this point, so we exit. */ |
/* OpenSSL is unable to verify the server hostname at this point, so we exit. */ |