SSL SNI support; important http-*:// fix; also http-post support added

This commit is contained in:
van Hauser 2016-06-15 19:53:36 +02:00
parent 4c25bddad7
commit 1579369097
52 changed files with 437 additions and 418 deletions

View file

@ -33,7 +33,7 @@ int start_redis(int s, char *ip, int port, unsigned char options, char *miscptr,
return 1;
}
void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, int tls) {
void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, int tls) {
int run = 1, next_run = 1, sock = -1;
int myport = PORT_REDIS, mysslport = PORT_REDIS_SSL;
@ -54,7 +54,7 @@ void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr,
} else {
if (port != 0)
mysslport = port;
sock = hydra_connect_ssl(ip, mysslport);
sock = hydra_connect_ssl(ip, mysslport, hostname);
port = mysslport;
}
if (sock < 0) {
@ -84,8 +84,8 @@ void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr,
}
}
void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
service_redis_core(ip, sp, options, miscptr, fp, port, 0);
void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
service_redis_core(ip, sp, options, miscptr, fp, port, hostname, 0);
}
/*
@ -103,7 +103,7 @@ void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE
* (error) ERR operation not permitted (for older redis versions)
* That is used for initial password authentication and redis server response tests in service_redis_init
*/
int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
// called before the childrens are forked off, so this is the function
// which should be filled if initial connections and service setup has to be
// performed once only.
@ -126,7 +126,7 @@ int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, F
} else {
if (port != 0)
mysslport = port;
sock = hydra_connect_ssl(ip, mysslport);
sock = hydra_connect_ssl(ip, mysslport, hostname);
port = mysslport;
}
if (verbose)