version 1.18, 2015/09/10 16:01:06 |
version 1.19, 2015/09/11 14:30:23 |
|
|
BIO_printf(bio_err, " only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n"); |
BIO_printf(bio_err, " only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n"); |
BIO_printf(bio_err, " are supported.\n"); |
BIO_printf(bio_err, " are supported.\n"); |
BIO_printf(bio_err, " -xmpphost host - connect to this virtual host on the xmpp server\n"); |
BIO_printf(bio_err, " -xmpphost host - connect to this virtual host on the xmpp server\n"); |
#ifndef OPENSSL_NO_ENGINE |
|
BIO_printf(bio_err, " -engine id - Initialise and use the specified engine\n"); |
|
#endif |
|
BIO_printf(bio_err, " -sess_out arg - file to write SSL session to\n"); |
BIO_printf(bio_err, " -sess_out arg - file to write SSL session to\n"); |
BIO_printf(bio_err, " -sess_in arg - file to read SSL session from\n"); |
BIO_printf(bio_err, " -sess_in arg - file to read SSL session from\n"); |
BIO_printf(bio_err, " -servername host - Set TLS extension servername in ClientHello\n"); |
BIO_printf(bio_err, " -servername host - Set TLS extension servername in ClientHello\n"); |
|
|
int mbuf_len = 0; |
int mbuf_len = 0; |
struct timeval timeout; |
struct timeval timeout; |
const char *errstr = NULL; |
const char *errstr = NULL; |
#ifndef OPENSSL_NO_ENGINE |
|
char *engine_id = NULL; |
|
char *ssl_client_engine_id = NULL; |
|
ENGINE *ssl_client_engine = NULL; |
|
#endif |
|
ENGINE *e = NULL; |
|
char *servername = NULL; |
char *servername = NULL; |
tlsextctx tlsextcbp = |
tlsextctx tlsextcbp = |
{NULL, 0}; |
{NULL, 0}; |
|
|
else |
else |
goto bad; |
goto bad; |
} |
} |
#ifndef OPENSSL_NO_ENGINE |
|
else if (strcmp(*argv, "-engine") == 0) { |
|
if (--argc < 1) |
|
goto bad; |
|
engine_id = *(++argv); |
|
} else if (strcmp(*argv, "-ssl_client_engine") == 0) { |
|
if (--argc < 1) |
|
goto bad; |
|
ssl_client_engine_id = *(++argv); |
|
} |
|
#endif |
|
else if (strcmp(*argv, "-4") == 0) { |
else if (strcmp(*argv, "-4") == 0) { |
af = AF_INET; |
af = AF_INET; |
} else if (strcmp(*argv, "-6") == 0) { |
} else if (strcmp(*argv, "-6") == 0) { |
|
|
} else |
} else |
next_proto.data = NULL; |
next_proto.data = NULL; |
|
|
#ifndef OPENSSL_NO_ENGINE |
|
e = setup_engine(bio_err, engine_id, 1); |
|
if (ssl_client_engine_id) { |
|
ssl_client_engine = ENGINE_by_id(ssl_client_engine_id); |
|
if (!ssl_client_engine) { |
|
BIO_printf(bio_err, |
|
"Error getting client auth engine\n"); |
|
goto end; |
|
} |
|
} |
|
#endif |
|
if (!app_passwd(bio_err, passarg, NULL, &pass, NULL)) { |
if (!app_passwd(bio_err, passarg, NULL, &pass, NULL)) { |
BIO_printf(bio_err, "Error getting password\n"); |
BIO_printf(bio_err, "Error getting password\n"); |
goto end; |
goto end; |
|
|
|
|
if (key_file) { |
if (key_file) { |
|
|
key = load_key(bio_err, key_file, key_format, 0, pass, e, |
key = load_key(bio_err, key_file, key_format, 0, pass, |
"client certificate private key file"); |
"client certificate private key file"); |
if (!key) { |
if (!key) { |
ERR_print_errors(bio_err); |
ERR_print_errors(bio_err); |
|
|
} |
} |
if (cert_file) { |
if (cert_file) { |
cert = load_cert(bio_err, cert_file, cert_format, |
cert = load_cert(bio_err, cert_file, cert_format, |
NULL, e, "client certificate file"); |
NULL, "client certificate file"); |
|
|
if (!cert) { |
if (!cert) { |
ERR_print_errors(bio_err); |
ERR_print_errors(bio_err); |
|
|
} |
} |
if (vpm) |
if (vpm) |
SSL_CTX_set1_param(ctx, vpm); |
SSL_CTX_set1_param(ctx, vpm); |
|
|
#ifndef OPENSSL_NO_ENGINE |
|
if (ssl_client_engine) { |
|
if (!SSL_CTX_set_client_cert_engine(ctx, ssl_client_engine)) { |
|
BIO_puts(bio_err, "Error setting client auth engine\n"); |
|
ERR_print_errors(bio_err); |
|
ENGINE_free(ssl_client_engine); |
|
goto end; |
|
} |
|
ENGINE_free(ssl_client_engine); |
|
} |
|
#endif |
|
|
|
#ifndef OPENSSL_NO_SRTP |
#ifndef OPENSSL_NO_SRTP |
if (srtp_profiles != NULL) |
if (srtp_profiles != NULL) |