- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我收到这个错误:
The remote certificate is invalid according to the validation procedure.
每当我尝试在我的 C# 代码中使用 Gmail 的 SMTP 服务器发送电子邮件时。有人可以指出解决此问题的正确方向吗?
以下是堆栈跟踪...
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Mail.SmtpConnection.Flush()
at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at BulkEmail.frmemail.mailsending(String toaddress, String fromaddress, String fromname, String subject, String pwd, String attachements, String mailmessage, String htmlmessage, Int32 i, Int32 j, String replytoaddress)
最佳答案
Warning: Do not use this in production code!
作为解决方法,您可以关闭证书验证。只有这样做才能确认错误是由于错误的证书而引发的。
在调用 smtpclient.Send()
之前调用此方法:
[Obsolete("Do not use this in Production code!!!",true)]
static void NEVER_EAT_POISON_Disable_CertificateValidation()
{
// Disabling certificate validation can expose you to a man-in-the-middle attack
// which may allow your encrypted message to be read by an attacker
// https://stackoverflow.com/a/14907718/740639
ServicePointManager.ServerCertificateValidationCallback =
delegate (
object s,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors
) {
return true;
};
}
关于c# - "The remote certificate is invalid according to the validation procedure."使用 Gmail SMTP 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59375307/
我有 3 个表: 1. 学生:{id, name, roll} 2. 主题:{id, name} 3. 分数:{student_id, subject_id, marks} 我有一个返回所有学生及其分
我将制作一款完全由程序生成的空间/交易/战斗游戏。但是,我知道将整个星系的所有细节存储在内存中是不可行的。因此,我一直认为我可以使用种子来生成太阳系,并且从该太阳系,您可以使用跳跃门前往其他太阳系。问
我有一个关于 ADS 中存储过程的性能的问题。我创建了一个具有以下结构的简单数据库: CREATE TABLE MainTable ( Id INTEGER PRIMARY KEY,
我想将这个简单的东西加载到我的编辑器中: Write:-repeat,write("hi"),nl,fail. 所以它打印“嗨”。 我该怎么办? 我目前正在尝试做 File->New 并将名为 Wri
在从 c# 调用过程中显示以下错误 "Procedure or function 'CALL get_Users()'cannot be foundin database 'joomla'."` 代码
在网上找到了创建存储过程的教程,只是不明白到底什么时候需要执行创建存储过程。 是否应该在每次重新启动 MySQL 服务器时执行存储过程创建? 我是否需要在每次启动我的应用程序时都执行存储过程创建sql
我有一个包含所有例程的 MySQL 转储。当我恢复时,只有存储过程没有恢复。我从中提取 Dump 的 MySQL 版本是 5.0.77-log,我恢复到的版本是 5.6.12。 感谢任何帮助。 谢谢
我是一家大量使用存储过程(500+)的公司的新手。为了帮助学习系统,我希望有一种简单的方法来构建一个树型列表,显示系统中的所有存储过程以及它们自己调用哪些存储过程......从而创建可以执行的存储过程
我需要使用 mysqldump 和 replace 而不是 insert 并且在恢复时不删除数据库和表。但我需要删除并重新创建触发器和存储过程 为此,我将 mysqldump 与 --replace
在执行代码的过程中,我在不同的Scheme实现中遇到以下错误: Racket : application: not a procedure; expected a procedure that ca
我想将存储过程输出参数映射到一个实体。 例如, PROCEDURE ForExample @ID int, @LastUpdate datetime OUTPUT AS Update EntityTa
假设我有“myStoredProcedure”,它接受一个 Id 作为参数,并返回一个信息表。 是否可以编写类似于此的 SQL 语句? SELECT MyColumn FROM Tabl
我想将整个 sql 查询作为词法参数传递给存储过程,然后执行它。任何建议如何做到这一点? 最佳答案 你可以试试这个: create or replace procedure my_proc(pstri
考虑以下测试用例: { CompilerVersion = 21 } procedure Global(); procedure Local(); begin end; type TP
在 Azure Cosmos Db 中,是否可以从另一个存储过程调用一个存储过程?那么UDF呢?我可以从另一个 UDF、存储过程或触发器调用一个 UDF吗? 最佳答案 is there a way t
在 Azure Cosmos Db 中,是否可以从另一个存储过程调用一个存储过程?那么UDF呢?我可以从另一个 UDF、存储过程或触发器调用一个 UDF吗? 最佳答案 is there a way t
在 LINQ to Entities 中,我将存储过程的结果集映射到实体。 在存储过程中,我执行一些更新语句并通过运行 SELECT 查询并将结果集映射到实体来返回结果集。 数据库行得到正确更新,但返
创建存储过程时,BEGIN/END 块是否有用途? 例如, CREATE PROCEDURE SPNAME AS SELECT * FROM TABLE 对比 CREATE PROCEDURE S
正如您在下面看到的,我的过程有两个参数。我希望它们都是整数。但是,当我使用非整数测试该过程时,它仍然可以编译!为什么? create procedure int_arith( p_1 int, p_
我有一个 Client类(class)。在那个类里面有一个数组 losses .首先,我创建并使用客户端填充 clientsColl大批。然后对于该数组中的每个客户端,我填充其 losses大批。 然
我是一名优秀的程序员,十分优秀!