forked from wolfSSL/wolfssl
add external site script test to make check
This commit is contained in:
@ -173,6 +173,9 @@ static void Usage(void)
|
|||||||
#ifdef HAVE_ANON
|
#ifdef HAVE_ANON
|
||||||
printf("-a Anonymous client\n");
|
printf("-a Anonymous client\n");
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_CRL
|
||||||
|
printf("-C Disable CRL\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
||||||
@ -208,7 +211,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
int doPeerCheck = 1;
|
int doPeerCheck = 1;
|
||||||
int nonBlocking = 0;
|
int nonBlocking = 0;
|
||||||
int resumeSession = 0;
|
int resumeSession = 0;
|
||||||
int wc_shutdown = 0;
|
int wc_shutdown = 0;
|
||||||
|
int disableCRL = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int scr = 0; /* allow secure renegotiation */
|
int scr = 0; /* allow secure renegotiation */
|
||||||
int forceScr = 0; /* force client initiaed scr */
|
int forceScr = 0; /* force client initiaed scr */
|
||||||
@ -262,11 +266,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
(void)verifyCert;
|
(void)verifyCert;
|
||||||
(void)useClientCert;
|
(void)useClientCert;
|
||||||
(void)overrideDateErrors;
|
(void)overrideDateErrors;
|
||||||
|
(void)disableCRL;
|
||||||
|
|
||||||
StackTrap();
|
StackTrap();
|
||||||
|
|
||||||
while ((ch = mygetopt(argc, argv,
|
while ((ch = mygetopt(argc, argv,
|
||||||
"?gdDusmNrwRitfxUPh:p:v:l:A:c:k:b:zS:L:ToO:a")) != -1) {
|
"?gdDusmNrwRitfxUPCh:p:v:l:A:c:k:b:zS:L:ToO:a")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '?' :
|
case '?' :
|
||||||
Usage();
|
Usage();
|
||||||
@ -284,6 +289,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
overrideDateErrors = 1;
|
overrideDateErrors = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'C' :
|
||||||
|
disableCRL = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'u' :
|
case 'u' :
|
||||||
doDTLS = 1;
|
doDTLS = 1;
|
||||||
break;
|
break;
|
||||||
@ -723,12 +732,14 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
|
|
||||||
wolfSSL_set_fd(ssl, sockfd);
|
wolfSSL_set_fd(ssl, sockfd);
|
||||||
#ifdef HAVE_CRL
|
#ifdef HAVE_CRL
|
||||||
if (wolfSSL_EnableCRL(ssl, WOLFSSL_CRL_CHECKALL) != SSL_SUCCESS)
|
if (disableCRL == 0) {
|
||||||
err_sys("can't enable crl check");
|
if (wolfSSL_EnableCRL(ssl, WOLFSSL_CRL_CHECKALL) != SSL_SUCCESS)
|
||||||
if (wolfSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, 0) != SSL_SUCCESS)
|
err_sys("can't enable crl check");
|
||||||
err_sys("can't load crl, check crlfile and date validity");
|
if (wolfSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, 0) != SSL_SUCCESS)
|
||||||
if (wolfSSL_SetCRL_Cb(ssl, CRL_CallBack) != SSL_SUCCESS)
|
err_sys("can't load crl, check crlfile and date validity");
|
||||||
err_sys("can't set crl callback");
|
if (wolfSSL_SetCRL_Cb(ssl, CRL_CallBack) != SSL_SUCCESS)
|
||||||
|
err_sys("can't set crl callback");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SECURE_RENEGOTIATION
|
#ifdef HAVE_SECURE_RENEGOTIATION
|
||||||
if (scr) {
|
if (scr) {
|
||||||
|
20
scripts/external.test
Executable file
20
scripts/external.test
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# external.test
|
||||||
|
|
||||||
|
server=www.wolfssl.com
|
||||||
|
ca=./certs/wolfssl-website-ca.pem
|
||||||
|
|
||||||
|
[ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
|
||||||
|
|
||||||
|
# is our desired server there?
|
||||||
|
ping -c 2 -i 0.2 $server
|
||||||
|
RESULT=$?
|
||||||
|
[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0
|
||||||
|
|
||||||
|
# client test against the server
|
||||||
|
./examples/client/client -C -h $server -p 443 -g -A $ca
|
||||||
|
RESULT=$?
|
||||||
|
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
|
||||||
|
|
||||||
|
exit 0
|
@ -10,6 +10,7 @@ endif
|
|||||||
|
|
||||||
if BUILD_EXAMPLES
|
if BUILD_EXAMPLES
|
||||||
dist_noinst_SCRIPTS+= scripts/resume.test
|
dist_noinst_SCRIPTS+= scripts/resume.test
|
||||||
|
dist_noinst_SCRIPTS+= scripts/external.test
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST += scripts/testsuite.pcap
|
EXTRA_DIST += scripts/testsuite.pcap
|
||||||
|
Reference in New Issue
Block a user