最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ssl - TLS client without any server verification - Stack Overflow

programmeradmin0浏览0评论

I'm writing a Toit program that needs to connect to a TLS server in my local network. The server is only able to handle TLS connections but because of the local network I don't need any verification.

Is there a way to disable the TLS verification?

I'm writing a Toit program that needs to connect to a TLS server in my local network. The server is only able to handle TLS connections but because of the local network I don't need any verification.

Is there a way to disable the TLS verification?

Share Improve this question asked Feb 1 at 21:00 Florian LoitschFlorian Loitsch 8,1281 gold badge28 silver badges34 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Toit doesn't provide any way of disabling TLS verification.

However, it's pretty easy to accept the certificate of your local server, even if it wasn't signed by a known certificate authority.

Start by getting the certificate of the local server. You can use Chrome, or simply openssl:

openssl s_client -connect <YOUR-MACHINE>

Take the certificate (typically starting with -----BEGIN CERTIFICATE-----) and store it in your Toit application:

CERTIFICATE ::= """
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

You can then install this certificate as follows:

import tls

CERT ::= """
...
"""

main:
  my-root := tls.RootCertificate CERT
  my-root.install
  // TLS connections to your server should now succeed.
发布评论

评论列表(0)

  1. 暂无评论