mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-04 21:49:38 +00:00
Add Postgres support to -starttls
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
parent
6215f27a83
commit
b2e54eb834
@ -739,7 +739,8 @@ typedef enum PROTOCOL_choice {
|
|||||||
PROTO_XMPP,
|
PROTO_XMPP,
|
||||||
PROTO_XMPP_SERVER,
|
PROTO_XMPP_SERVER,
|
||||||
PROTO_CONNECT,
|
PROTO_CONNECT,
|
||||||
PROTO_IRC
|
PROTO_IRC,
|
||||||
|
PROTO_POSTGRES
|
||||||
} PROTOCOL_CHOICE;
|
} PROTOCOL_CHOICE;
|
||||||
|
|
||||||
static const OPT_PAIR services[] = {
|
static const OPT_PAIR services[] = {
|
||||||
@ -751,6 +752,7 @@ static const OPT_PAIR services[] = {
|
|||||||
{"xmpp-server", PROTO_XMPP_SERVER},
|
{"xmpp-server", PROTO_XMPP_SERVER},
|
||||||
{"telnet", PROTO_TELNET},
|
{"telnet", PROTO_TELNET},
|
||||||
{"irc", PROTO_IRC},
|
{"irc", PROTO_IRC},
|
||||||
|
{"postgres", PROTO_POSTGRES},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2084,6 +2086,25 @@ int s_client_main(int argc, char **argv)
|
|||||||
goto shut;
|
goto shut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case PROTO_POSTGRES:
|
||||||
|
{
|
||||||
|
static const unsigned char ssl_request[] = {
|
||||||
|
/* Length SSLRequest */
|
||||||
|
0, 0, 0, 8, 4, 210, 22, 47
|
||||||
|
};
|
||||||
|
int bytes;
|
||||||
|
|
||||||
|
/* Send SSLRequest packet */
|
||||||
|
BIO_write(sbio, ssl_request, 8);
|
||||||
|
(void)BIO_flush(sbio);
|
||||||
|
|
||||||
|
/* Reply will be a single S if SSL is enabled */
|
||||||
|
bytes = BIO_read(sbio, sbuf, BUFSIZZ);
|
||||||
|
if (bytes != 1 || sbuf[0] != 'S')
|
||||||
|
goto shut;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -420,7 +420,7 @@ command for more information.
|
|||||||
send the protocol-specific message(s) to switch to TLS for communication.
|
send the protocol-specific message(s) to switch to TLS for communication.
|
||||||
B<protocol> is a keyword for the intended protocol. Currently, the only
|
B<protocol> is a keyword for the intended protocol. Currently, the only
|
||||||
supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
|
supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
|
||||||
and "irc."
|
"irc" and "postgres."
|
||||||
|
|
||||||
=item B<-xmpphost hostname>
|
=item B<-xmpphost hostname>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user