HPE OneView
1820595 Members
1312 Online
109626 Solutions
New Discussion

Powershell Core proxy connectivity issues to OneView

 
CSKA
Advisor

Powershell Core proxy connectivity issues to OneView

Hello, 
I'm expecting the following issue when connecting to OneView from Powershell core, if proxy settings are applied.

OneView Appliance 8.30.01
OV Module - HPEOneView.830
PSVersion - 7.3.7
OS - Windows Server 2022

Error Message: 

VERBOSE: [SEND-OVREQUEST] Filtering for Connection Object via String: myoneview.com
VERBOSE: [SEND-OVREQUEST] Processing 'myoneview.com' appliance connection request. 1 of 1
VERBOSE: [SEND-OVREQUEST] Requested URI '/rest/version' to 'myoneview.com'
VERBOSE: [SEND-OVREQUEST] We have reached the URI Whitelist condition block. Unauth request allowed for '/rest/version'.
VERBOSE: [CONNECT-OVMGMT] Exception caught when checking X-API version.
Connect-OVMgmt: Exception calling "RestClient" with "3" argument(s): "The ServicePointManager does not support proxies with the https scheme."

The proxy settings are configured via PowerShell profile, where http proxy is configured. The OneView appliance is also added in the bypass list, but the OneView module still crashes and tried to connect via proxy. If I remove the proxy settings, or use system default proxy on PS 5.1 connection is working. Here is the Proxy Profile:

[System.Net.Http.HttpClient]::DefaultProxy = New-Object System.Net.WebProxy("http://10.11.12.13:8088")
[System.Net.Http.HttpClient]::DefaultProxy.BypassProxyOnLocal = $true
$list = @('.myoneview.com','myoneview.com')
[System.Net.Http.HttpClient]::DefaultProxy.BypassList = $list

All other services which are on the same domain (bypassed) working fine, for example connection to different C7000 enclosures,  vCenters and etc. Seems like the OneView module found that https proxy is configured, but the actual config is on http proxy and correctly configured bypass list.

6 REPLIES 6
ChrisLynch
HPE Pro

Re: Powershell Core proxy connectivity issues to OneView

The HPE OneView PowrShell library uses the HttpWebReqeust class, not use the HTTPClient class.  Looking into this further, the issue isn't necessarily with the library, but ServicePointManager.  It is the source of the error.

I think I found a solution here, but it will require an update to the library which I am working on publishing.

I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
CSKA
Advisor

Re: Powershell Core proxy connectivity issues to OneView

@ChrisLynch 

Hi Chris,
Thanks for looking into this thread.
I think that in PowerShell core/7 the proxy configuration is using the System.Net.HttpClient class instead of the System.Net.WebRequest class to perform web requests in the Invoke-WebRequest, Find-Module, Install-Module, etc. cmdlets. If you think I can switch back to proxy with System.Net.WebRequest library in PS7 I will try it.
Could you please ping in the thread when you publish the new version.
Thanks!

OliverAn
Advisor

Re: Powershell Core proxy connectivity issues to OneView

I am facing the same issue, thanks for looking into it!

ChrisLynch
HPE Pro

Re: Powershell Core proxy connectivity issues to OneView

A new 8.30 library is being released now.  So expect the update to be in PowerShell Gallery later today (US time).

I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
CSKA
Advisor

Re: Powershell Core proxy connectivity issues to OneView

Hello @ChrisLynch ,

The issue still exist with Module 8.30.3660.2366 and 8.50.3667.2043 and PS 7.3.7

DannyRWS
New Member

Re: Powershell Core proxy connectivity issues to OneView

@ChrisLynch 

Same here, is there any resolution scheduled?