diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-02-20 14:56:38 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-02-20 14:56:38 +0100 |
commit | 02615365a92ca2570c1f96abc8a97674aa2ccae1 (patch) | |
tree | ebedfd91a0f6d299b39e84295e091e12c0767dc8 /stap-client-connect.c | |
parent | c3bad3042df505a3470f1e20b09822a9df1d4761 (diff) | |
parent | adc67597f327cd43d58b1d0cb740dab14a75a058 (diff) | |
download | systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.tar.gz systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.tar.xz systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.zip |
Merge branch 'master' into pr6866
Conflicts:
ChangeLog: Removed
runtime/ChangeLog: Removed
runtime/sym.c: Merged
runtime/task_finder.c: Merged
tapset/ChangeLog: Removed
testsuite/ChangeLog: Removed
Diffstat (limited to 'stap-client-connect.c')
-rw-r--r-- | stap-client-connect.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/stap-client-connect.c b/stap-client-connect.c index 9466b566..fd3b950c 100644 --- a/stap-client-connect.c +++ b/stap-client-connect.c @@ -27,6 +27,7 @@ #include <nss.h> #include <prerror.h> #include <secerr.h> +#include <sslerr.h> #define READ_BUFFER_SIZE (60 * 1024) static char *hostName = NULL; @@ -74,6 +75,12 @@ errWarn(char *function) case SEC_ERROR_CA_CERT_INVALID: fputs ("The issuer's certificate is invalid\n", stderr); break; + case SEC_ERROR_BAD_DATABASE: + fputs ("The specified certificate database does not exist or is not valid\n", stderr); + break; + case SSL_ERROR_BAD_CERT_DOMAIN: + fputs ("The requested domain name does not match the server's certificate\n", stderr); + break; case PR_CONNECT_RESET_ERROR: fputs ("Connection reset by peer\n", stderr); break; @@ -307,10 +314,12 @@ static SECStatus do_connect(PRNetAddr *addr) { PRFileDesc *sslSocket; + PRStatus prStatus; +#if 0 PRHostEnt hostEntry; char buffer[PR_NETDB_BUF_SIZE]; - PRStatus prStatus; PRIntn hostenum; +#endif SECStatus secStatus; secStatus = SECSuccess; @@ -338,7 +347,7 @@ do_connect(PRNetAddr *addr) errWarn("SSL_SetURL"); goto done; } - +#if 0 /* Already done? */ /* Prepare and setup network connection. */ prStatus = PR_GetHostByName(hostName, buffer, sizeof(buffer), &hostEntry); if (prStatus != PR_SUCCESS) @@ -355,7 +364,7 @@ do_connect(PRNetAddr *addr) secStatus = SECFailure; goto done; } - +#endif prStatus = PR_Connect(sslSocket, addr, PR_INTERVAL_NO_TIMEOUT); if (prStatus != PR_SUCCESS) { @@ -397,7 +406,7 @@ do_connect(PRNetAddr *addr) } static void -client_main(unsigned short port, const char *hostName) +client_main(unsigned short port) { SECStatus secStatus; PRStatus prStatus; @@ -479,10 +488,12 @@ main(int argc, char **argv) /* All cipher suites except RSA_NULL_MD5 are enabled by Domestic Policy. */ NSS_SetDomesticPolicy(); - client_main(port, hostName); + client_main(port); NSS_Shutdown(); PR_Cleanup(); return 0; } + +/* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */ |