C#pop3を使用してGmailに接続しようとしていますが、次のエラーが発生します。検証手順に従ってリモート証明書が無効です。
以下のコードを使用して接続します
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Xml;
public void Connect()
{
if (Client == null)
Client = new TcpClient();
if (!Client.Connected)
Client.Connect(Host, Port);
if (IsSecure)
{
SslStream secureStream = new SslStream(Client.GetStream());
secureStream.AuthenticateAsClient(Host);
ClientStream = secureStream;
secureStream = null;
}
else
ClientStream = Client.GetStream();
Writer = new StreamWriter(ClientStream);
Reader = new StreamReader(ClientStream);
ReadLine();
Login();
}
ここで私のホストは「pop.gmail.com」で、ポートは「995」です。
secureStream.AuthenticateAsClient(Host); この行でエラーが発生しました
「検証手順に従って、リモート証明書が無効です。」
この問題を解決するために何か提案してください。