mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-03 10:03:12 +02:00
Show a meaningful error when connecting to an SSL-only port with STARTTLS (iotw: if you forgot ssl in link::outgoing::options).
This commit is contained in:
@@ -596,6 +596,15 @@ int ircd_SSL_accept(aClient *acptr, int fd) {
|
||||
}
|
||||
return fatal_ssl_error(ssl_err, SAFE_SSL_ACCEPT, ERRNO, acptr);
|
||||
case SSL_ERROR_WANT_READ:
|
||||
if ((acptr->ssl->packet_length >= 8) && !strncmp(acptr->ssl->packet, "STARTTLS", 8))
|
||||
{
|
||||
char buf[512];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"ERROR :STARTTLS received but this is an SSL-only port. Check your connect settings. "
|
||||
"If this is a server linking in then add 'ssl' in your link::outgoing::options block.\r\n");
|
||||
send(fd, buf, strlen(buf), 0);
|
||||
return fatal_ssl_error(ssl_err, SAFE_SSL_ACCEPT, ERRNO, acptr);
|
||||
}
|
||||
fd_setselect(fd, FD_SELECT_READ, ircd_SSL_accept_retry, acptr);
|
||||
fd_setselect(fd, FD_SELECT_WRITE, NULL, acptr);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user