Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPE remoting proxy uses HTTP instead of HTTPS #1005

Closed
2 of 3 tasks
sitecorepm opened this issue May 18, 2018 · 0 comments
Closed
2 of 3 tasks

SPE remoting proxy uses HTTP instead of HTTPS #1005

sitecorepm opened this issue May 18, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@sitecorepm
Copy link

Expected Behavior

When calling "New-ScriptSession" with a URL using HTTPS, the resulting $session.Connection.Proxy.Url should also use HTTPS.

Actual Behavior

When calling "New-ScriptSession" with a URL using HTTPS, the resulting $session.Connection.Proxy.Url is returning HTTP.

Steps to Reproduce the Problem

This is a problem specific to our networking setup.

Client ----(HTTPS)----> LB ----(HTTP)----> Server

Our load balancer (LB) hosts our SSL cert and does NOT re-encrypt traffic to the server, therefore the WSDL file response uses HTTP instead of HTTPS as the service URL.

To work around this issue, I added the following code to the New-ScriptSession.ps1 (at line 119)

$proxy = New-WebServiceProxy @proxyProps
if($Credential) {
    $proxy.Credentials = $Credential
} elseif ($UseDefaultCredential.IsPresent) {
    $proxy.UseDefaultCredentials = $true
}

# -------------- WORKAROUND----------------------------------------
# If the returned proxy URL doesn't match schemes, force it
# This can happen due to load balancers hosting SSL certs instead of the server 
if (!$proxy.Url.StartsWith($uri.Scheme + "://")){
    Write-Verbose "Changing proxy URL scheme to: $($uri.Scheme)"
    $proxy.Url = $proxy.Url -replace "^https?", $uri.Scheme
}
# -------------- END WORKAROUND----------------------------------------

if($Timeout -gt 0) {
    $proxy.Timeout = $Timeout * 1000
}

Related Slack chat (https://sitecorechat.slack.com/archives/C09THADMX/p1526664713000342)

SPE 4.7 and Sitecore 7.5

  • Tested issue with clean install of Sitecore and the latest available version of SPE.

  • Asked questions on the Sitecore Slack Chat channel.

  • Reviewed questions and answers on the Sitecore Stack Exchange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants