简体   繁体   English

如何验证ASP.NET MVC Web API是否使用SSL

[英]How to verify asp.net mvc web API is utilizing SSL

I have created a asp.net mvc web api project. 我已经创建了一个ASP.NET MVC Web API项目。 I am passing sensitive data to a web api application. 我正在将敏感数据传递到Web API应用程序。 The web api application I created requires ssl. 我创建的Web API应用程序需要ssl。 When I call the web api using https I would like to verify that the information is encrypted from end to end. 当我使用https调用网络api时,我想验证信息是否从头到尾都已加密。 Is there a way to do this or am I just being paranoid. 有没有办法做到这一点,或者我只是偏执。

You can configure IIS to require SSL (and IIS will perform redirections on your behalf) but the main way is by doing this: 您可以将IIS配置为要求SSL(IIS将代表您执行重定向),但是主要方法是这样做:

if( Request.IsSecureConnection ) {
    // Using SSL or TLS.
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM