unity editor 使用 aws s3 sdk
2017-09-18 10:54
816 查看
在unity Editor 编码配套工具时使用到aws 的 s3。在.net 平台下充分测试后 将代码转至unity 中发现 无法与服务器连上
环境: unity 5.1.3f
awsDll :awssdk.core.3.3.17.9 和 awssdk.s3.3.3.11
捕获异常时发现
Google 之 使用如下解决方案
毕
环境: unity 5.1.3f
awsDll :awssdk.core.3.3.17.9 和 awssdk.s3.3.3.11
捕获异常时发现
System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0 at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in <filename unknown>:0 at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process () at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0 at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.HttpRequest.GetResponse () [0x00000] in <filename unknown>:0 " " at Amazon.Runtime.Internal.WebExceptionHandler.HandleException (IExecutionContext executionContext, System.Net.WebException exception) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.ExceptionHandler`1[T].Handle (IExecutionContext executionContext, System.Exception exception) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.ErrorHandler.ProcessException (IExecutionContext executionContext, System.Exception exception) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.ErrorHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.PipelineHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.CallbackHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.PipelineHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.Signer.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.PipelineHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.CredentialsRetriever.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.PipelineHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.RetryHandler.InvokeSync (IExecutionContext executionContext) [0x00000] in <filename unknown>:0 "
Google 之 使用如下解决方案
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallback; protected bool CertificateValidationCallback(System.Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { bool isOk = true; // If there are errors in the certificate chain, // look at each error to determine the cause. if (sslPolicyErrors != SslPolicyErrors.None) { for (int i = 0; i < chain.ChainStatus.Length; i++) { if (chain.ChainStatus[i].Status == X509ChainStatusFlags.RevocationStatusUnknown) { continue; } chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain; chain.ChainPolicy.RevocationMode = X509RevocationMode.Online; chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0); chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags; bool chainIsValid = chain.Build((X509Certificate2)certificate); if (!chainIsValid) { isOk = false; break; } } } return isOk; }
毕
相关文章推荐
- java使用AWS S3 SDK 上传文件至 DigitalOcean Spaces
- AWS IOT C++ SDK 使用
- AWS S3的使用
- AWS CLI使用s3
- 初次使用AWS S3服务
- ruby on rails爬坑(四):使用AWS S3存取数据
- ceph rgw java sdk 使用域名访问服务时需要设置s3client的配置项 PathStyleAccess 为true, 负责将报域名异常
- golang aws-sdk-go 之 s3 服务
- AWS s3 python sdk code examples
- AWS S3使用Demo
- 使用 AWS 的 GO SDK 获取区域与终端节点信息
- AWS CLI以及AWS S3 SYNC命令行使用
- AWS Python SDK boto3中的基本概念与使用方法
- s3cmd在配置后使用时提示ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.
- AWS S3使用小结
- 【golang】aws s3 go sdk
- 使用aws中国的s3时,制订bucket poicy时注意注意……
- 使用AWS SDK for Java创建并启动EC2实例
- AWS S3 resource访问:使用 S3 URI 地址格式
- AmazonS3 使用 AWS SDK for Java