Skip to content

SPE remoting proxy uses HTTP instead of HTTPS #1005

Description

@sitecorepm

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions