SuperSocket通过证书文件启用 TLS/SSL

你需要通过下面的步骤修改配置文件来使用你准备好的证书文件:

在server节点设置security属性;

在server节点下增加certificate子节点;

最后配置应该像这样:

<server name="EchoServer"

        serverTypeName="EchoService"

        ip="Any" port="443"

        security="tls">

    <certificate filePath="localhost.pfx" password="supersocket"></certificate>

</server>

提示: certificate节点的password属性的值是这个证书文件的私钥

还有一个可选的配置选项 "keyStorageFlags" 用于证书加载:

<certificate filePath="localhost.pfx"

             password="supersocket"

             keyStorageFlags="UserKeySet"></certificate>

猜你喜欢

转载自www.cnblogs.com/fanweisheng/p/11127145.html