From 2b1673c9c83f693fdf243607f9141e5e897e0ba8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 8 Sep 2004 08:08:38 +0000 Subject: Now the test servers and test cases can run on a custom port number. There's no fixed port numbers in use anymore. Starting now, the default ports the servers use are 8990 - 8993. There's no option to modify these yet, but changing the $base option in the top of the runtests.pl script. --- tests/libtest/lib509.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests/libtest') diff --git a/tests/libtest/lib509.c b/tests/libtest/lib509.c index eabddacee..9e535e9b6 100644 --- a/tests/libtest/lib509.c +++ b/tests/libtest/lib509.c @@ -18,6 +18,7 @@ #include #include +int portnum; /* the HTTPS port number we use */ typedef struct sslctxparm_st { CURL* curl; @@ -63,6 +64,8 @@ static unsigned char *my_get_ext(X509 * cert, const int type, void * globalparm = NULL; +char newurl[512]; + static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg) { sslctxparm * p = (sslctxparm *) arg; @@ -113,7 +116,15 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg) (char *)accessinfoURL, (char *)p->accessinfoURL); OPENSSL_free(p->accessinfoURL); p->accessinfoURL = accessinfoURL; - curl_easy_setopt(p->curl, CURLOPT_URL,p->accessinfoURL); + + /* We need to be able to deal with a custom port number, but the + URL in the cert uses a static one. We thus need to create a new + URL that uses the currently requested port number which may not + be the one this URL uses! */ + sprintf(newurl, "https://localhost:%d/509", portnum); + fprintf(stderr, "But *really* Setting URL <%s>\n", newurl); + + curl_easy_setopt(p->curl, CURLOPT_URL, newurl); } else OPENSSL_free(accessinfoURL); @@ -164,6 +175,10 @@ int test(char *URL) int i = 0; CURLMsg *msg; + if(arg2) { + portnum = atoi(arg2); + } + curl_global_init(CURL_GLOBAL_ALL); p.curl = curl_easy_init(); -- cgit v1.2.3