X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Ftlsproxy.c;h=25f37043394518b1c02184fb775925ef1564d4f2;hb=80e82203daef6daf7a16219876fc404e12f82c8a;hp=7a27f5531335368b6e80be8fa7ee159c4ea54919;hpb=5f6ff9f4d1bb1f4bdc01700110435aa1b29c2bcf;p=tlsproxy%2Ftlsproxy.git diff --git a/src/tlsproxy.c b/src/tlsproxy.c index 7a27f55..25f3704 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -168,14 +168,12 @@ int main(int argc, char **argv) { return EXIT_FAILURE; } -#ifdef DEBUG /* Fast rebinding for debug mode, could cause invalid packets. */ - { + if (LOG_DEBUG <= global_log_level) { int socket_option = 1; setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &socket_option, sizeof(socket_option)); } -#endif /* Bind to the listen socket. */ memset(&server_in, 0, sizeof(server_in)); @@ -272,8 +270,9 @@ static void parse_arguments(int argc, char **argv) { #else global_log_level = LOG_WARNING; #endif + global_passthrough_unknown = 0; - while (-1 != (option = getopt(argc, argv, "d:p:t:h?"))) { + while (-1 != (option = getopt(argc, argv, "d:p:t:uh?"))) { switch (option) { case 'd': { if (0 > atoi(optarg)) { @@ -324,6 +323,10 @@ static void parse_arguments(int argc, char **argv) { thread_count = (size_t)atoi(optarg); break; } + case 'u': { + global_passthrough_unknown = 1; + break; + } case 'h': default: /* '?' */ print_usage(argv[0]); @@ -338,12 +341,15 @@ static void parse_arguments(int argc, char **argv) { } } static void print_usage(const char *argv) { - fprintf(stderr, "Usage: %s [-d level] [-p host:port] [-t count] port\n", + fprintf(stderr, "Usage: %s [-d level] [-p host:port] [-t count] [-u] port\n", argv); fprintf(stderr, "\n"); fprintf(stderr, "-d debug level: 0=errors only, 2=debug [default: 1]\n"); fprintf(stderr, "-p proxy hostname and port\n"); fprintf(stderr, "-t number of threads [default: 10]\n"); + fprintf(stderr, "-u passthrough connection if no certificate is stored \ +[default: error]\n"); + fprintf(stderr, " WARNING: might be a security problem!\n"); } static void initialize_gnutls(void) {