我尝试使用PowerShell设置从Jenkins部署Azure Cloud Service到Azure但是当我尝试执行Get-AzureDeployment时,我收到错误' System.Net.Http.HttpRequestException:发生错误在发送请求时。 ---> System.Net.WebException:请求已中止:无法创建SSL / TLS安全通道。'
我也尝试从我的本地计算机上获取相同的错误。我正在运行的脚本是:
Import-AzurePublishSettingsFile -PublishSettingsFile "C:\Temp\CloudFareABTPublishSettings.publishsettings"
Set-AzureSubscription -SubscriptionName "CloudFare ABT Test"
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls1 -bor [System.Net.SecurityProtocolType]::Tls -bor [System.Net.SecurityProtocolType]::Ssl3;
Get-AzureDeployment -ServiceName "CloudFareJourneyService" -Slot "Production" -ErrorVariable b -ErrorAction silentlycontinue
if($b[0] -ne $null)
{
$b[0] | fl * -force
}
我从PowerShell获得的输出是:
PSMessageDetails :
Exception : System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS
secure channel.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Microsoft.WindowsAzure.Management.Compute.DeploymentOperationsExtensions.GetBySlot(IDeploymentOperations operations, String serviceName, DeploymentSlot
deploymentSlot)
at Microsoft.WindowsAzure.Commands.Utilities.Common.ServiceManagementBaseCmdlet.ExecuteClientActionNewSM[TResult](Object input, String operationDescription, Func`1
action, Func`3 contextFactory)
TargetObject :
CategoryInfo : CloseError: (:) [Get-AzureDeployment], HttpRequestException
FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, C:\Users\srichmond\Documents\CloudFare\Azure\TestingScripts.ps1: line 7
PipelineIterationInfo : {0, 1}
我已经尝试过查看WireShark中的流量,我可以看到这一系列消息:
Client Hello
Server Hello, Certificate, Server Key Exchange, Server Hello Done
Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
Change Cipher Spec, Encrypted Handshake Message
没有客户完成或服务器完成消息的迹象,但我不知道这是否重要。
非常感谢任何帮助。