0

I am trying to setup the certificate verification in opensips along with the blink sip client. I followed the tutorial:

https://github.com/antonraharja/book-opensips-101/blob/master/content/3.2.%20SIP%20TLS%20Secure%20Calling.mediawiki

My config look like so:

[opensips.cfg]
disable_tls = no
listen = tls:my_ip:5061
tls_verify_server= 0
tls_verify_client = 1
tls_require_client_certificate = 1
#tls_method = TLSv1
tls_method = SSLv23
tls_certificate = "/usr/local/etc/opensips/tls/server/server-cert.pem"
tls_private_key = "/usr/local/etc/opensips/tls/server/server-privkey.pem"
tls_ca_list = "/usr/local/etc/opensips/tls/server/server-calist.pem"

So i generated the rootCA and the server certificate. Then i took the server-calist.pem added the server-privkey.pem in there (otherwise blink sip client won't load it) and set it in client. I also set the server-calist.pem as a certificate authority in the blink. But when i try to login to my server i get:

Feb  4 21:02:42 user /usr/local/sbin/opensips[28065]: DBG:core:tcp_read_req: Using the global ( per process ) buff
Feb  4 21:02:42 user /usr/local/sbin/opensips[28065]: DBG:core:tls_update_fd: New fd is 17
Feb  4 21:02:42 user /usr/local/sbin/opensips[28065]: ERROR:core:tls_accept: New TLS connection from 130.85.9.114:48253 failed to accept: rejected by client

So i assume that the client doesn't accept the server certificate for some reason, although i have the "Verify server" checkbox turned off in my blink sip client! I think i have the wrong certificate authority file.

./user/user-cert.pem
./user/user-cert_req.pem
./user/user-privkey.pem
./user/user-calist.pem     <- this 4 are for using opensips as a client i think
./rootCA/certs/01.pem
./rootCA/private/cakey.pem
./rootCA/cacert.pem
./server/server-privkey.pem
./server/server-calist.pem
./server/server-cert.pem
./server/server-cert_req.pem
./calist.pem

Can anybody help, did i do something wrong i the config or did i use the wrong certificate chain? What certificate exactly should be used by the client as a client cert, and ca authority cert?

4

1 回答 1

0

好吧,我仍然不确定它是否有效,因为授权行为变得很奇怪,但是在挂起 5-6 分钟后,我获得了成功授权,所以这是一个解决方案:

生成根CA:

opensipsctl tls rootCA

然后server.conf在您的tlsopensips 文件夹中编辑文件并设置commonName = xxx.xxx.xxx.xxxxxx.xxx.xxx.xxx 是您的服务器 IP 地址。可以以任何方式编辑其他变量。生成 CA 签署的证书

opensipsctl tls userCERT server

这将产生 4 个文件。下载 server-calist.pem、server-cert.pem、server-privkey.pem。打开 server-privkey.pem,复制它的内容并粘贴到文件 server-cert.pem 中,在实际证书之前。如果您使用的是 blink,则生成的 server-cert.pem 将进入首选项->帐户->高级。server-calist.pem 进入首选项->高级。在重新启动眨眼之后,5-6 分钟后您的帐户将被登录。但我观察到一个奇怪的行为,如果您运行另一个眨眼副本并在您从第一个帐户登录尝试登录另一个现有帐户有了证书,您可以在不提供证书的情况下从其他帐户登录。所以我不知道,但我认为它有效。

PS我询问了opensips邮件列表中的证书,但我想他们发现我的问题太蹩脚了,所以我没有得到回复。如果您有同样的问题并获得了更好的结果或来自 opensips 支持的答案,请告诉我。

于 2015-02-09T22:32:06.257 回答