summaryrefslogtreecommitdiffstats
path: root/stap-client-connect.c
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-01-28 16:19:21 -0500
committerWilliam Cohen <wcohen@redhat.com>2009-01-28 16:19:21 -0500
commit7914abbdb3050c04628b0daaec2349b257998715 (patch)
tree753819d68d965409af5e19516146bca8c744bc16 /stap-client-connect.c
parentff90b2974f841b92434cb46d89c39f08d01cc966 (diff)
parent078198eb01e89d1b79ae96203525d59945f68067 (diff)
downloadsystemtap-steved-7914abbdb3050c04628b0daaec2349b257998715.tar.gz
systemtap-steved-7914abbdb3050c04628b0daaec2349b257998715.tar.xz
systemtap-steved-7914abbdb3050c04628b0daaec2349b257998715.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'stap-client-connect.c')
-rw-r--r--stap-client-connect.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/stap-client-connect.c b/stap-client-connect.c
index 9466b566..fd64f6c7 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,7 +488,7 @@ 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();