SslStream.AuthenticateAsClient()验证失败

world_wolf 2012-03-31 05:27:53
如下是我做的一个读取邮件内容的一段程序,下面是我连接邮箱服务器的一段代码
我连接邮箱服务器serverTcpConnection = new TcpClient(popServer, port);
连接已成功,但我在 ((SslStream)pop3Stream).AuthenticateAsClient(popServer);
验证时一直提示 System.IO.IOException: 由于意外的数据包格式,握手失败。

if (pop3ConnectionState != Pop3ConnectionStateEnum.Disconnected &&
pop3ConnectionState != Pop3ConnectionStateEnum.Closed &&
!isTimeoutReconnect)
{
CallWarning("connect", "", "Connect command received, but connection state is: " + pop3ConnectionState.ToString());
}
else
{
//establish TCP connection
try
{
CallTrace(" Connect at port {0}", port);
serverTcpConnection = new TcpClient(popServer, port);
}
catch (Exception ex)
{
throw new Pop3Exception("Connection to server " + popServer + ", port " + port + " failed.\nRuntime Error: " + ex.ToString());
}

if (useSSL)
{
//get SSL stream
try
{
CallTrace(" Get SSL connection");
pop3Stream = new SslStream(serverTcpConnection.GetStream(), false);
pop3Stream.ReadTimeout = readTimeout;
}
catch (Exception ex)
{
throw new Pop3Exception("Server " + popServer + " found, but cannot get SSL data stream.\nRuntime Error: " + ex.ToString());
}

//perform SSL authentication
try
{
CallTrace(" Get SSL authentication");
((SslStream)pop3Stream).AuthenticateAsClient(popServer);
}
catch (Exception ex)
{
throw new Pop3Exception("Server " + popServer + " found, but problem with SSL Authentication.\nRuntime Error: " + ex.ToString());
}
...全文
650 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lin131 2012-10-31
  • 打赏
  • 举报
回复
碰到一样的问题,不知道能不能直接把确认SSL的身份给去掉
world_wolf 2012-04-01
  • 打赏
  • 举报
回复
没人?
内容概要:本文围绕可变桨叶四旋翼无人机的规范控制与点对点运动模拟展开,重点研究优化推力分配策略在翻转动作中的应用与性能比较。通过Matlab代码实现,构建了四旋翼动力学模型,并设计了多种控制算法以实现精确的姿态调整与轨迹跟踪。研究对比了不同推力分配方案在执行高机动性翻转动作时的稳定性、能耗效率与响应速度,旨在提升无人机在复杂飞行任务中的动态性能与控制精度。该仿真研究为无人机飞控系统的设计与优化提供了理论依据和技术支持。; 适合人群:具备一定自动控制理论基础和Matlab编程能力,从事无人机控制、飞行器动力学或机器人系统研究的科研人员及研究生。; 使用场景及目标:① 实现四旋翼无人机在三维空间中的精确点对点运动控制;② 对比分析不同推力分配策略在执行翻转等高难度动作时的控制效果与能耗表现,优化飞行性能;③ 为无人机自主飞行、特技飞行及复杂环境下的机动控制提供算法验证平台。; 阅读建议:此资源以Matlab仿真为核心,建议读者结合相关控制理论知识,深入理解代码实现细节,重点关注动力学建模、控制律设计与推力分配模块。在学习过程中,应动手调试参数,复现文中翻转动作的仿真结果,并尝试拓展至其他复杂飞行任务,以加深对无人机控制机理的理解。

111,132

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧