IOResult ssl_send_encrypt_plain(struct SSLConnection *connection, char *buf, int len);
extern int ssl_connection_flush(struct SSLConnection *connection);
+extern const char* ssl_get_cipher(struct SSLConnection *connection);
+
#endif /* INCLUDED_parse_h */
if(cli_connect(sptr)->con_ssl) {
SetSSLConn(sptr);
+
+ const char *cipher = ssl_get_cipher(cli_connect(sptr)->con_ssl);
+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :You are connected to %s with %s", sptr, cli_name(&me), cipher);
}
}
else {
return 0;
}
+const char* ssl_get_cipher(struct SSLConnection *connection) {
+ if(!connection)
+ return NULL;
+ return SSL_get_cipher(connection->session);
+}
+
#else
void ssl_free_connection(struct SSLConnection *connection) {}
void ssl_free_listener(struct SSLConnection *listener) {}
struct SSLConnection *ssl_start_handshake_listener(struct SSLListener *listener, int fd, void *data, enum SSLDataType datatype) { return NULL; }
IOResult ssl_recv_decrypt(struct SSLConnection *connection, char *buf, int *len) { return IO_FAILURE; }
int ssl_connection_flush(struct SSLConnection *connection) { return 0; };
+const char* ssl_get_cipher(struct SSLConnection *connection) { return NULL; }
#endif