aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib509.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-09-08 08:08:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-09-08 08:08:38 +0000
commit2b1673c9c83f693fdf243607f9141e5e897e0ba8 (patch)
treee967f8e015573633ab666251360a31316abceb31 /tests/libtest/lib509.c
parent702f549a6a0126923806132a3b45621f55a8a0af (diff)
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.
Diffstat (limited to 'tests/libtest/lib509.c')
-rw-r--r--tests/libtest/lib509.c17
1 files changed, 16 insertions, 1 deletions
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 <openssl/bio.h>
#include <openssl/ssl.h>
+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();