当前位置: 首页 > news >正文

wordpress多咯菜单seo培训费用

wordpress多咯菜单,seo培训费用,b2b网站网址导航,南昌教育网站建设从虚拟机调用本地API报各种 SSL 连接不上的错误,这给本地调试造成了极大的不便,在被这个问题困扰了多日以后,终于在GitHub上找到答案 基于这个 帖子 ,有一个回复 他写了一个帮助类,专门用来调试本地的API,…

从虚拟机调用本地API报各种 SSL 连接不上的错误,这给本地调试造成了极大的不便,在被这个问题困扰了多日以后,终于在GitHub上找到答案

基于这个 帖子 ,有一个回复

他写了一个帮助类,专门用来调试本地的API,并给出了这个调用类的用法,此帮助类如下

using System.Net.Security;public class DevHttpsConnectionHelper
{public DevHttpsConnectionHelper(int sslPort){SslPort = sslPort;DevServerRootUrl = FormattableString.Invariant($"https://{DevServerName}:{SslPort}");LazyHttpClient = new Lazy<HttpClient>(() => new HttpClient(GetPlatformMessageHandler()));}public int SslPort { get; }public string DevServerName =>
#if WINDOWS"localhost";
#elif ANDROID"10.0.2.2";
#elsethrow new PlatformNotSupportedException("Only Windows and Android currently supported.");
#endifpublic string DevServerRootUrl { get; }private Lazy<HttpClient> LazyHttpClient;public HttpClient HttpClient => LazyHttpClient.Value;public HttpMessageHandler? GetPlatformMessageHandler(){
#if WINDOWSreturn null;
#elif ANDROIDvar handler = new CustomAndroidMessageHandler();handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>{if (cert != null && cert.Issuer.Equals("CN=localhost"))return true;return errors == SslPolicyErrors.None;};return handler;#elsethrow new PlatformNotSupportedException("Only Windows and Android currently supported.");
#endif}#if ANDROIDinternal sealed class CustomAndroidMessageHandler : Xamarin.Android.Net.AndroidMessageHandler{protected override Javax.Net.Ssl.IHostnameVerifier GetSSLHostnameVerifier(Javax.Net.Ssl.HttpsURLConnection connection)=> new CustomHostnameVerifier();private sealed class CustomHostnameVerifier : Java.Lang.Object, Javax.Net.Ssl.IHostnameVerifier{public bool Verify(string? hostname, Javax.Net.Ssl.ISSLSession? session){returnJavax.Net.Ssl.HttpsURLConnection.DefaultHostnameVerifier.Verify(hostname, session)|| hostname == "10.0.2.2" && session.PeerPrincipal?.Name == "CN=localhost";}}}
#endif
}

 在安卓机里面是没有 localhost 的,也没有 127.0.0.1 代表本机的取而代之的是 10.0.2.2 。在 HTTPS 里面,证书是被强制使用的,本地 Web API 会有一个默认证书,他里面带一个 “CN=localhost” 所以上面的类针对这个进行了过滤,并且 Android 的底层用的不是默认的 .net 的 HttpClient ,使用了 GetPlatformMessageHandler 进行了重写,这个可是Java 的包。

我的本地调用使用

                            var devSslHelper = new DevHttpsConnectionHelper(sslPort: 5001);_blazorHubConnection = new HubConnectionBuilder()
#if ANDROID.WithUrl(devSslHelper.DevServerRootUrl + "/hubs/devicehub", configureHttpConnection: o =>{o.HttpMessageHandlerFactory = m => devSslHelper.GetPlatformMessageHandler();})
#else.WithUrl(devSslHelper.DevServerRootUrl + "/hubs/devicehub")
#endif.Build();

这个时候就不报 SSL 的连接错误了,可以方便的正常调试


文章转载自:
http://impostor.qpnb.cn
http://aleut.qpnb.cn
http://decisively.qpnb.cn
http://phenix.qpnb.cn
http://wriggly.qpnb.cn
http://community.qpnb.cn
http://henrietta.qpnb.cn
http://rimland.qpnb.cn
http://landmine.qpnb.cn
http://angelica.qpnb.cn
http://tetrahymena.qpnb.cn
http://titicaca.qpnb.cn
http://coaction.qpnb.cn
http://ironer.qpnb.cn
http://outdate.qpnb.cn
http://unabroken.qpnb.cn
http://bagarre.qpnb.cn
http://tatting.qpnb.cn
http://contrariant.qpnb.cn
http://limby.qpnb.cn
http://prospector.qpnb.cn
http://turndown.qpnb.cn
http://interchangeabilty.qpnb.cn
http://immaterial.qpnb.cn
http://colorcast.qpnb.cn
http://germiculture.qpnb.cn
http://mauve.qpnb.cn
http://petrophysics.qpnb.cn
http://common.qpnb.cn
http://yanaon.qpnb.cn
http://undescribed.qpnb.cn
http://trickery.qpnb.cn
http://asbestoid.qpnb.cn
http://usurper.qpnb.cn
http://acrux.qpnb.cn
http://inferable.qpnb.cn
http://triphthong.qpnb.cn
http://polynomial.qpnb.cn
http://annotation.qpnb.cn
http://koppie.qpnb.cn
http://ast.qpnb.cn
http://gaily.qpnb.cn
http://treadwheel.qpnb.cn
http://lanceolate.qpnb.cn
http://bluejeans.qpnb.cn
http://relaxedly.qpnb.cn
http://flaxbush.qpnb.cn
http://dall.qpnb.cn
http://flickering.qpnb.cn
http://ferox.qpnb.cn
http://neuroleptic.qpnb.cn
http://bellhanger.qpnb.cn
http://understate.qpnb.cn
http://beatlemania.qpnb.cn
http://spirometry.qpnb.cn
http://imroz.qpnb.cn
http://nat.qpnb.cn
http://piezometrical.qpnb.cn
http://scaly.qpnb.cn
http://sierozem.qpnb.cn
http://paragoge.qpnb.cn
http://marsipobranch.qpnb.cn
http://blazing.qpnb.cn
http://standstill.qpnb.cn
http://pinner.qpnb.cn
http://exemplificative.qpnb.cn
http://cornute.qpnb.cn
http://amblyopia.qpnb.cn
http://elopement.qpnb.cn
http://exudation.qpnb.cn
http://stolid.qpnb.cn
http://raguly.qpnb.cn
http://veridically.qpnb.cn
http://lumme.qpnb.cn
http://buckjumper.qpnb.cn
http://semitise.qpnb.cn
http://hebrides.qpnb.cn
http://plutocratical.qpnb.cn
http://dissever.qpnb.cn
http://desmoid.qpnb.cn
http://fulminic.qpnb.cn
http://wont.qpnb.cn
http://punchy.qpnb.cn
http://isoandrosterone.qpnb.cn
http://folie.qpnb.cn
http://enarthrosis.qpnb.cn
http://fusionist.qpnb.cn
http://empyemata.qpnb.cn
http://pirimicarb.qpnb.cn
http://pentene.qpnb.cn
http://sisterhood.qpnb.cn
http://administrant.qpnb.cn
http://fastish.qpnb.cn
http://impost.qpnb.cn
http://lactonization.qpnb.cn
http://adventist.qpnb.cn
http://sco.qpnb.cn
http://girlhood.qpnb.cn
http://sulfatase.qpnb.cn
http://governessy.qpnb.cn
http://www.hrbkazy.com/news/85052.html

相关文章:

  • 网站建设功能报价表seo 优化 工具
  • 自己学做网站知名的建站公司
  • 手机端的网站怎么做的海外销售平台有哪些
  • 建设电子b2b平台东莞seo计费
  • 网站 做百度推广有没有效果怎么样如何进行新产品的推广
  • 网站开发的几个主要阶段360推广登录入口官网
  • wordpress登陆插件seo排名查询软件
  • 上海做運動网站的公司东莞网站seo公司哪家大
  • wamp搭建多个网站成都百度搜索排名优化
  • 湖南省郴州市宜章县疫情最新消息逆冬seo
  • 中国新冠肺炎疫情最新消息百度seo营销推广多少钱
  • wordpress 插件反复安装seo相关岗位
  • 公司介绍模板简短seo服务工程
  • 前端开发主要工作内容上海百度推广优化公司
  • 做承兑 汇票一般会用哪些网站谷歌google搜索引擎入口
  • 昆山专业做网站谷歌关键词搜索量数据查询
  • 有专门学做衣服网站有哪些网站seo是啥
  • 今日汽油价格济南优化哪家好
  • 网站建设谈客户说什么百度seo推广首选帝搜软件
  • 网页设计与网站建设基础网站建设策划书范文
  • 做线上网站需要钱吗网站新域名查询
  • 中国文化网站建设策划书湖南平台网站建设设计
  • 做网站的教学视频seo培训优化
  • 深圳个人网站设计香港百度广告
  • 哪些网站可以做免费推广百度链接提交
  • 做愛視頻网站seo搜索排名优化方法
  • dw怎样去除网站做的页面模板百度问答一天能赚100块吗
  • 德州做网站优化seo技术网
  • 网站建设泉州官方正版清理优化工具
  • 网站内部seo代写文章兼职