开发者

Https with Tcplistener

开发者 https://www.devze.com 2023-01-27 03:40 出处:网络
I am building an application that can receive requests from a website to perform functionality not available in a browser. I accomplished this using a Tcplistener and then call in to it by performing

I am building an application that can receive requests from a website to perform functionality not available in a browser. I accomplished this using a Tcplistener and then call in to it by performing ajax calls with jquery using jsonp. This is fine and works well, the problem now however is that the website also has to be able to use HTTPS, this results in a warning when making ajax calls that are not encrypted which is not desirable.

Is it possible to use https to make calls to my application without having a certificate registered on the users pc, as my appl开发者_高级运维ication is I guess the server.

I hope that makes sense and I am not being stupid.

Many Thanks


This answer is for C# .NET

For HTTPS calls, the example is provided on MSDN using TCP Listner and TCP Client.

https://learn.microsoft.com/en-us/dotnet/api/system.net.security.sslstream?redirectedfrom=MSDN&view=netframework-4.7.2#Anchor_5

When doing sslStream.AuthenticateAsServer(serverCertificate, ..) you should load a PFX file along with password, instead of CER file, then it will not require registration on client machine.

0

精彩评论

暂无评论...
验证码 换一张
取 消