sko*_*enb 3 asp.net hosting ubuntu-14.04 asp.net-core
安装库MailKit并调用后,出现new SmtpClient().ConnectAsync(_settings.Server, _settings.Port, _settings.SSL);此错误:
拒绝访问路径“ /var/www/.dotnet/corefx/cryptography/crls”。
顺便说一句,我的项目位于/ media / ProjectName上。我尝试执行此操作:sudo chmod -R 755 /var但是我获得了权限错误。
这是stacktrace:
在System.IO.UnixFileSystem.CreateDirectory(String fullPath)吗?在System.IO.Directory.CreateDirectory(字符串路径)?在Internal.Cryptography.Pal.CrlCache.GetCachedCrlPath(X509Certificate2 cert,布尔mkDir)?在Internal.Cryptography.Pal.CrlCache.DownloadAndAddCrl(X509Certificate2证书,SafeX509StoreHandle存储,TimeSpan和剩余的DownloadTime)中?在Internal.Cryptography.Pal.CrlCache.AddCrlForCertificate(X509Certificate2证书,SafeX509StoreHandle存储,X509RevocationMode撤销模式,DateTime验证时间,TimeSpan和剩余的下载时间)处?在Internal.Cryptography.Pal.OpenSslX509ChainProcessor.BuildChain(X509Certificate2 leaf,HashSet
1 candidates, HashSet1 download,HashSet1 systemTrusted, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan& remainingDownloadTime)? at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)? at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)? at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName)? at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback)? at System.Net.Security.SslState.CompleteHandshake()? 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.ReadFrameCallback(AsyncProtocolRequest asyncRequest)?--- End of stack trace from previous location where exception was thrown ---? at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()? at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)? at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)? at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)? at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar,Func)2 endFunction, Action1 endAction,Task`1 promise,Boolean requireSynchronization)?-从上一个引发异常的位置开始的堆栈结束跟踪- 在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)上?在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)上?在MailKit.Net.Smtp.SmtpClient.Connect(字符串主机,Int32端口,SecureSocketOptions选项,CancellationToken cancelledToken)?在MailKit.MailService。<> c__DisplayClass41_0.b__0()吗?在System.Threading.Tasks.Task.Execute()处吗?-从上一个引发异常的位置开始的堆栈结束跟踪---?在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)上?在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)上?在MyProject.Services.MessageService。d__4.MoveNext()?---从上一个引发异常的位置开始的堆栈跟踪---?在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)上?在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)上?在MyProject.Services.MessageService.d__5.MoveNext()
Lex Li发布后,创建目录/var/www/.dotnet/corefx/cryptography/crls并授予www-data组的权限(如果这是运行您的服务的组)
须藤chgrp www-data /var/www/.dotnet/corefx/cryptography/crls
| 归档时间: |
|
| 查看次数: |
2350 次 |
| 最近记录: |