//location:websocket监听地址(wss) WebSocketServer server = new WebSocketServer(location); //添加证书(certificatePath:证书路径,password:访问证书数据所需的密码) server.Certificate = new System.Security.Cryptography.X509Certificates.X509Certificate2(certificatePath, password);