使用C#与SSL服务进行通信 [英] using C# to communicate with a SSL service

查看:167
本文介绍了使用C#与SSL服务进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想编写一个客户端,它将与ssl进行通信,发送一些数据并获得响应。
我看到了一些应用程序与Web服务通信的部分示例,但我想要使用套接字通信进行通信,而不是将我的请求作为Web服务或普通数据。
如果有人指导我完成这项工作,我将非常感激。这就是我的想法。 >点击1。交换证书信息
2。发送数据
3。接收数据

非常感谢

解决方案

在System.Net.Security中使用SslStream类。

以下链接可以用例子解释你。

http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx

Hi All,
I want to write a client, that will communicate with a ssl send some data and get response back.
I have seen some partial examples where an app communicates with web services, however I want to communicate using socket communication without basing my request to be a  web service or plain data.
I would really appreciate it if some one get guide me to get this done.
this is what I have in my mind

1. Exchange the certificate info
2. Send data
3. Receive data

Thanks a lot

解决方案

Use SslStream class in System.Net.Security.

Following link can explain you with example.

http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx


这篇关于使用C#与SSL服务进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆