I add the --with-wolfssl flag to my build config. I'm assembling, during the assembly process, an error:
gcc -c -pipe -march=native -mtune=native -O2 -pipe -fno-plt -DNDEBUG -pthread -Wall wolfssl.c -o wolfssl.o
grep -v '^#MASTER#' default.action.master > default.action
wolfssl.c:58:53: error: unknown type name ‘X509’
58 | static int ssl_store_cert(struct client_state *csp, X509 *crt);
| ^~~~
wolfssl.c:77:2: warning: #warning wolfSSL has been compiled without WOLFSSL_ALT_CERT_CHAINS [-Wcpp]
77 | #warning wolfSSL has been compiled without WOLFSSL_ALT_CERT_CHAINS
| ^~~~~~~
wolfssl.c: In function ‘get_public_key_size_string’:
wolfssl.c:247:12: error: ‘EVP_PKEY_RSA’ undeclared (first use in this function)
247 | case EVP_PKEY_RSA:
| ^~~~~~~~~~~~
wolfssl.c:247:12: note: each undeclared identifier is reported only once for each function it appears in
wolfssl.c:249:12: error: ‘EVP_PKEY_DSA’ undeclared (first use in this function)
249 | case EVP_PKEY_DSA:
| ^~~~~~~~~~~~
wolfssl.c:251:12: error: ‘EVP_PKEY_EC’ undeclared (first use in this function)
251 | case EVP_PKEY_EC:
| ^~~~~~~~~~~
wolfssl.c: At top level:
wolfssl.c:275:53: error: unknown type name ‘X509’
275 | static int ssl_store_cert(struct client_state *csp, X509 *cert)
| ^~~~
wolfssl.c: In function ‘create_server_ssl_connection’:
wolfssl.c:1186:2: warning: #warning Looks like wolfssl has been compiled without HAVE_RENEGOTIATION_INDICATION [-Wcpp]
1186 | #warning Looks like wolfssl has been compiled without HAVE_RENEGOTIATION_INDICATION
| ^~~~~~~
wolfssl.c:1203:28: error: ‘X509_V_OK’ undeclared (first use in this function)
1203 | if (verify_result == X509_V_OK)
| ^~~~~~~~~
wolfssl.c:1218:18: warning: implicit declaration of function ‘wolfSSL_get_peer_cert_chain’; did you mean ‘wolfSSL_get_peer_chain’? [-Wimplicit-function-declaration]
1218 | chain = wolfSSL_get_peer_cert_chain(ssl);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| wolfSSL_get_peer_chain
wolfssl.c:1218:16: warning: assignment to ‘WOLFSSL_STACK *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1218 | chain = wolfSSL_get_peer_cert_chain(ssl);
| ^
wolfssl.c:1222:29: warning: implicit declaration of function ‘wolfSSL_sk_X509_num’; did you mean ‘wolfSSL_sk_X509_pop’? [-Wimplicit-function-declaration]
1222 | for (i = 0; i < wolfSSL_sk_X509_num(chain); i++)
| ^~~~~~~~~~~~~~~~~~~
| wolfSSL_sk_X509_pop
wolfssl.c:1224:20: warning: implicit declaration of function ‘ssl_store_cert’ [-Wimplicit-function-declaration]
1224 | if (ssl_store_cert(csp, wolfSSL_sk_X509_value(chain, i)) != 0)
| ^~~~~~~~~~~~~~
wolfssl.c:1224:40: warning: implicit declaration of function ‘wolfSSL_sk_X509_value’; did you mean ‘wolfSSL_sk_X509_CRL_value’? [-Wimplicit-function-declaration]
1224 | if (ssl_store_cert(csp, wolfSSL_sk_X509_value(chain, i)) != 0)
| ^~~~~~~~~~~~~~~~~~~~~
| wolfSSL_sk_X509_CRL_value
wolfssl.c: In function ‘generate_rsa_key’:
wolfssl.c:1477:10: warning: implicit declaration of function ‘wc_MakeRsaKey’; did you mean ‘wc_FreeRsaKey’? [-Wimplicit-function-declaration]
1477 | ret = wc_MakeRsaKey(&rsa_key, RSA_KEYSIZE, RSA_KEY_PUBLIC_EXPONENT,
| ^~~~~~~~~~~~~
| wc_FreeRsaKey
wolfssl.c:1487:19: warning: implicit declaration of function ‘wc_RsaKeyToDer’; did you mean ‘wc_EccKeyToDer’? [-Wimplicit-function-declaration]
1487 | der_key_size = wc_RsaKeyToDer(&rsa_key, rsa_key_der, sizeof(rsa_key_der));
| ^~~~~~~~~~~~~~
| wc_EccKeyToDer
wolfssl.c:1495:19: warning: implicit declaration of function ‘wc_DerToPem’; did you mean ‘wc_BerToDer’? [-Wimplicit-function-declaration]
1495 | pem_key_size = wc_DerToPem(rsa_key_der, (word32)der_key_size,
| ^~~~~~~~~~~
| wc_BerToDer
wolfssl.c: At top level:
wolfssl.c:1548:8: error: unknown type name ‘X509’
1548 | static X509 *ssl_certificate_load(const char *cert_path)
| ^~~~
wolfssl.c: In function ‘ssl_certificate_load’:
wolfssl.c:1550:4: error: unknown type name ‘X509’
1550 | X509 *cert = NULL;
| ^~~~
wolfssl.c:1560:17: warning: implicit declaration of function ‘PEM_read_X509’ [-Wimplicit-function-declaration]
1560 | if (!(cert = PEM_read_X509(cert_f, NULL, NULL, NULL)))
| ^~~~~~~~~~~~~
wolfssl.c:1560:15: warning: assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1560 | if (!(cert = PEM_read_X509(cert_f, NULL, NULL, NULL)))
| ^
wolfssl.c: In function ‘ssl_certificate_is_invalid’:
wolfssl.c:1590:4: error: unknown type name ‘X509’
1590 | X509 *cert = NULL;
| ^~~~
wolfssl.c:1597:66: warning: passing argument 1 of ‘wolfSSL_X509_get_notAfter’ from incompatible pointer type [-Wincompatible-pointer-types]
1597 | ret = wolfSSL_X509_cmp_current_time(wolfSSL_X509_get_notAfter(cert));
| ^~~~
| |
| int *
In file included from /usr/include/wolfssl/openssl/conf.h:41,
from /usr/include/wolfssl/openssl/x509v3.h:29,
from wolfssl.c:39:
/usr/include/wolfssl/ssl.h:1924:78: note: expected ‘const WOLFSSL_X509 *’ but argument is of type ‘int *’
1924 | WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_get_notAfter(const WOLFSSL_X509* x509);
| ~~~~~~~~~~~~~~~~~~~~^~~~
wolfssl.c:1605:22: warning: passing argument 1 of ‘wolfSSL_X509_free’ from incompatible pointer type [-Wincompatible-pointer-types]
1605 | wolfSSL_X509_free(cert);
| ^~~~
| |
| int *
/usr/include/wolfssl/ssl.h:2864:62: note: expected ‘WOLFSSL_X509 *’ but argument is of type ‘int *’
2864 | WOLFSSL_ABI WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509* x509);
| ~~~~~~~~~~~~~~^~~~
wolfssl.c: At top level:
wolfssl.c:1738:2: error: #error wolfSSL lacks Subject Alternative Name support
1738 | #error wolfSSL lacks Subject Alternative Name support
| ^~~~~
wolfssl.c: In function ‘set_subject_alternative_name’:
wolfssl.c:1770:15: error: ‘struct Cert’ has no member named ‘altNames’
1770 | certificate->altNames[0] = 0x30; /* Sequence */
| ^~
wolfssl.c:1771:15: error: ‘struct Cert’ has no member named ‘altNames’
1771 | certificate->altNames[1] = (unsigned char)hostname_length + 2;
| ^~
wolfssl.c:1773:15: error: ‘struct Cert’ has no member named ‘altNames’
1773 | certificate->altNames[2] = 0x82; /* DNS name */
| ^~
wolfssl.c:1774:15: error: ‘struct Cert’ has no member named ‘altNames’
1774 | certificate->altNames[3] = (unsigned char)hostname_length;
| ^~
wolfssl.c:1775:23: error: ‘struct Cert’ has no member named ‘altNames’
1775 | memcpy(&certificate->altNames[4], hostname, hostname_length);
| ^~
wolfssl.c:1777:15: error: ‘struct Cert’ has no member named ‘altNamesSz’
1777 | certificate->altNamesSz = (int)hostname_length + 4;
| ^~
wolfssl.c: In function ‘generate_host_certificate’:
wolfssl.c:1862:23: error: ‘struct Cert’ has no member named ‘subject’
1862 | strncpy(certificate.subject.country, CERT_PARAM_COUNTRY_CODE, CTC_NAME_SIZE);
| ^
wolfssl.c:1863:23: error: ‘struct Cert’ has no member named ‘subject’
1863 | strncpy(certificate.subject.org, "Privoxy", CTC_NAME_SIZE);
| ^
wolfssl.c:1864:23: error: ‘struct Cert’ has no member named ‘subject’
1864 | strncpy(certificate.subject.unit, "Development", CTC_NAME_SIZE);
| ^
wolfssl.c:1865:23: error: ‘struct Cert’ has no member named ‘subject’
1865 | strncpy(certificate.subject.commonName, csp->http->host, CTC_NAME_SIZE);
| ^
wolfssl.c: At top level:
wolfssl.c:243:20: warning: ‘get_public_key_size_string’ defined but not used [-Wunused-function]
243 | static const char *get_public_key_size_string(int key_type)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [GNUmakefile:314: wolfssl.o] Error 1
make: *** Waiting for unfinished jobs....
==> ERROR: A failure occurred in build().
Aborting...
OS Archlinux, wolfssl 5.6.6-1, last snapshot privoxy-35e5250.tar
Thanks a lot for the report.
"Subject Alternative Name" support is required so you have to use a wolfSSL build that has been compiled with WOLFSSL_ALT_NAMES.
If you rebuild wolfSSL anyway you may want to compare your defines with mine:
https://lists.privoxy.org/pipermail/privoxy-devel/2024-March/000751.html
I just added another header which should also help so please try to recompile after pulling the current git master branch.
I built wolfssl with your config. There is still an error when compiling:
The version I'm using (5.7) doesn't have the WOLFSSL_ALT_NAMES option.
My config:
Last edit: withoutname 2024-03-31
WOLFSSL_ALT_NAMES is not a configure option but has to be set with the CFLAGS.
I use:
CFLAGS+= -DWOLFSSL_ALT_NAMES -DFP_MAX_BITS=8192 -DNO_WOLFSSL_STUB -DWOLFSSL_ALT_CERT_CHAINS -DHAVE_IO_TIMEOUT
Unfortunately, my knowledge is not enough to do this.
Same here. And the wolfssl support forum isn't any help:
https://www.wolfssl.com/forums/post7561.html
Fabian,
Could you show how you built wolfssl and then privoxy?
Thanks
Lee
As an ElectroBSD user I use the FreeBSD ports system with a modified security/wolfssl port:
I use poudriere to build the package.
When building Privoxy I use the --with-wolfssl option.
Manually using the autotools build works for me as well:
To get all the tests working I have to patch some of them but upstream rejected the PR:
https://github.com/wolfSSL/wolfssl/pull/5704
I managed to build a version with wolfssl. But some domains don’t work, the log shows the message “Error: X509 certificate verification for i.kommersant.ru failed with error -308: error state on socket”, while it works with openssl.
Which WolfSSL version do you use?
When I try i.kommersant.ru it doesn't seem to respond to requests to port 443 so it doesn't work with either OpenSSL or WolfSSL for me.
WolfSSL 5.7
i.kommersant.ru works when you click the button (if there is one) under the news. The site that definitely does not work for me with WolfSSL: traxxas.com, instead of opening it I see the message:
In the log there is a message "Error: X509 certificate verification for traxxas.com failed with error -313: received alert fatal error"
i.kommersant.ru remains unreachable for me but I can reproduce the problem with https://traxxas.com/ with both Privoxy and curl linked against wolfSSL 5.7.
I consider this a wolfSSL bug worth reporting upstream. Do you want to do it or should I?
If it's not too much trouble for you, please spread the word.
Regarding i.kommersant.ru, if you open this link "https://www.kommersant.ru/doc/6821399#comments" and click the blue button under the message, user comments should load, but instead you will see that message in the log, and the comments will not load.
Last edit: withoutname 2024-07-10
I can reproduce the issue that the comments don't load on https://www.kommersant.ru/ but on my systems the problem seems to be that connections to i.kommersant.ru already fail before the TLS handshake:
For the other issue I filed wolfSSL bug #7735: Can't establish TLS connections to https://traxxas.com/.
Thank you!
Regarding i.kommersant.ru, geoblocking is possible, but not sure, because... curl works for me:
The wolfSSL issue has been fixed upstream a while ago.