strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

how to set the private certificate of openssl? #164

Closed TitusSun closed 2 years ago

TitusSun commented 4 years ago

Hi, below interface is not implemented. so it need to implement by oursefves?

tls_set_credentials()

or is there other place to set the credentials?

pasis commented 4 years ago

Hi, this interface was never used. Even if you implement this function for openssl module, you will need to create public API to allow application to pass their certificates. Something is implemented in tls_gnutls.c module, however it is not used by other code.

If you have time for this, you can implement and send pull request for this feature. Or, you can simply hardcode your certificate somewhere for testing.

TitusSun commented 4 years ago

@pasis OK, thanks. if I need to implement it. I will send the request.

pasis commented 4 years ago

@TitusSun take a look at this branch: https://github.com/strophe/libstrophe/tree/cafile . xmpp_conn_tls_cafile() should do what you need. examples/basic.c shows a small example.

sjaeckel commented 2 years ago

there are now two new API functions that should solve this, right?

xmpp_conn_set_cafile() resp. xmpp_conn_set_capath()

if this solves your problem, please close this issue.

sjaeckel commented 2 years ago

I'm closing this as there was no action for too long. Please re-open if you have further questions/comments.