-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: ‘X509_V_ERR_HOSTNAME_MISMATCH’ undeclared (first use in this function) if (err == X509_V_ERR_HOSTNAME_MISMATCH) #490
Comments
How did you configure and build? It almost looks like you are trying to compile with TLS (the default when setting up CMake env from scratch), but that there may not be any OpenSSL library available? But in that case I believe it cmake would have complained that it cannot find OpenSSL library... |
Thanks for you quick response. I installed the openssl: however, there are other two questions confused me.
Since the followed sequence not work.
2: how to build target with static openssl lib. Since most of machines don't have openss 1.1+ version. |
See new README section for details Resolves #490 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
I am using CMake to build, so I don't know the details on where to find the libraries. Based on what you have provided, here is what I would do:
This will locate the OpenSSL library for you. If it does not find it, it will return an error. Note that I have submitted a PR to be able to statically link the OpenSSL libraries. For that, you would need to remove the cache and pass that new option:
That will make the NATS C client library be statically linked to the OpenSSL libraries (if found) |
/data/home/user00/xixie/nats.c/src/conn.c: In function ‘_collectSSLErr’:
/data/home/user00/xixie/nats.c/src/conn.c:602:20: error: ‘X509_V_ERR_HOSTNAME_MISMATCH’ undeclared (first use in this function)
if (err == X509_V_ERR_HOSTNAME_MISMATCH)
^
/data/home/user00/xixie/nats.c/src/conn.c:602:20: note: each undeclared identifier is reported only once for each function it appears in
/data/home/user00/xixie/nats.c/src/conn.c: In function ‘_makeTLSConn’:
/data/home/user00/xixie/nats.c/src/conn.c:693:17: warning: implicit declaration of function ‘SSL_get0_param’ [-Wimplicit-function-declaration]
X509_VERIFY_PARAM *param = SSL_get0_param(ssl);
^
/data/home/user00/xixie/nats.c/src/conn.c:693:44: warning: initialization makes pointer from integer without a cast [enabled by default]
X509_VERIFY_PARAM *param = SSL_get0_param(ssl);
^
/data/home/user00/xixie/nats.c/src/conn.c:694:17: warning: implicit declaration of function ‘X509_VERIFY_PARAM_set_hostflags’ [-Wimplicit-function-declaration]
X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
^
/data/home/user00/xixie/nats.c/src/conn.c:694:56: error: ‘X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS’ undeclared (first use in this function)
X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
^
/data/home/user00/xixie/nats.c/src/conn.c:695:17: warning: implicit declaration of function ‘X509_VERIFY_PARAM_set1_host’ [-Wimplicit-function-declaration]
if (!X509_VERIFY_PARAM_set1_host(param, nc->tlsName, 0))
^
make[2]: *** [src/CMakeFiles/nats.dir/conn.c.o] Error 1
make[1]: *** [src/CMakeFiles/nats.dir/all] Error 2
The text was updated successfully, but these errors were encountered: