欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

.net core signalR 忽略https 证书

程序员文章站 2022-11-10 21:38:19
var connection = new HubConnectionBuilder().WithUrl(serverUrl, option => { option.HttpMessageHandlerFactory = (handler) => { var ne... ......
var connection = new hubconnectionbuilder().withurl(serverurl, option =>
             {
                 option.httpmessagehandlerfactory = (handler) =>
                 {
                     var newhandler = handler as httpclienthandler;
                     newhandler.servercertificatecustomvalidationcallback = (request, cert, chain, errors) =>
                     {
                         return true;
                     };
                     return newhandler;
                 };
             }).build();