mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-20 13:23:57 -07:00
added -O option to support SSL servers that are SSLv3 only
This commit is contained in:
parent
1965e69d92
commit
3cde13d4f3
3 changed files with 27 additions and 9 deletions
23
hydra-mod.c
23
hydra-mod.c
|
@ -47,6 +47,7 @@ int __first_connect = 1;
|
|||
char ipstring[64];
|
||||
unsigned int colored_output = 1;
|
||||
char quiet = 0;
|
||||
int old_ssl = 0;
|
||||
|
||||
#ifdef LIBOPENSSL
|
||||
SSL *ssl = NULL;
|
||||
|
@ -468,13 +469,23 @@ int internal__hydra_connect_to_ssl(int socket) {
|
|||
|
||||
if (sslContext == NULL) {
|
||||
/* context: ssl2 + ssl3 is allowed, whatever the server demands */
|
||||
// if ((sslContext = SSL_CTX_new(SSLv23_client_method())) == NULL) {
|
||||
if ((sslContext = SSL_CTX_new(TLSv1_2_client_method())) == NULL) {
|
||||
if (verbose) {
|
||||
err = ERR_get_error();
|
||||
fprintf(stderr, "[ERROR] SSL allocating context: %s\n", ERR_error_string(err, NULL));
|
||||
if (old_ssl) {
|
||||
if ((sslContext = SSL_CTX_new(SSLv23_client_method())) == NULL) {
|
||||
if (verbose) {
|
||||
err = ERR_get_error();
|
||||
fprintf(stderr, "[ERROR] SSL allocating context: %s\n", ERR_error_string(err, NULL));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
// if ((sslContext = SSL_CTX_new(SSLv23_client_method())) == NULL) {
|
||||
if ((sslContext = SSL_CTX_new(TLSv1_2_client_method())) == NULL) {
|
||||
if (verbose) {
|
||||
err = ERR_get_error();
|
||||
fprintf(stderr, "[ERROR] SSL allocating context: %s\n", ERR_error_string(err, NULL));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/* set the compatbility mode */
|
||||
SSL_CTX_set_options(sslContext, SSL_OP_ALL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue