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

Issues with Invoke-WebRequest and preview 1 #7738

Closed
hurricanehrndz opened this issue Sep 7, 2018 · 15 comments
Closed

Issues with Invoke-WebRequest and preview 1 #7738

hurricanehrndz opened this issue Sep 7, 2018 · 15 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module

Comments

@hurricanehrndz
Copy link

hurricanehrndz commented Sep 7, 2018

Seem to have tls issues in version 6.1 rc1 when I did not have issues on 6.0.4

Steps to reproduce

Invoke-WebRequest -Uri "https://api.github.com/repos/PowerShell/PowerShell/releases" -Verbose  

Expected behavior

VERBOSE: GET https://api.github.com/repos/PowerShell/PowerShell/releases with 0-byte payload
VERBOSE: received 797618-byte response of content type application/json
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              StatusCode        : 200                                                                                                                                                                                                                        StatusDescription : OK                                                                                                                                                                                                                         
Content           : [{"url":"https://api.github.com/repos/PowerShell/PowerShell/releases/12526658","assets_url":"https://api.github.com/repos/PowerShell/PowerShell/releases/12526658/assets","upload_url":"https://uploads....
RawContent        : HTTP/1.1 200 OK
                    Server: GitHub.com
                    Date: Fri, 07 Sep 2018 19:19:20 GMT
                    Status: 200 OK
                    X-RateLimit-Limit: 60
                    X-RateLimit-Remaining: 58
                    X-RateLimit-Reset: 1536349489
                    Cache-Control: public, max-age=60, s...
Headers           : {[Server, System.String[]], [Date, System.String[]], [Status, System.String[]], [X-RateLimit-Limit, System.String[]]...}
Images            : {}
InputFields       : {}
Links             : {}
RawContentLength  : 797618
RelationLink      : {[next, https://api.github.com/repositories/49609581/releases?page=2], [last, https://api.github.com/repositories/49609581/releases?page=2]}

Actual behavior

VERBOSE: GET https://api.github.com/repos/PowerShell/PowerShell/releases with 0-byte payload
Invoke-WebRequest : error:2006D080:BIO routines:BIO_new_file:no such file
At line:1 char:1
+ Invoke-WebRequest -Uri "https://api.github.com/repos/PowerShell/Power ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Method: GET, Re...rShell/6.1.0
}:HttpRequestMessage) [Invoke-WebRequest], HttpRequestException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Environment data

Ubuntu 18.04.1, snap install(powershell,powershell-preview) Cisco IPS firepower

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-rc.1
PSEdition                      Core
GitCommitId                    6.1.0-rc.1
OS                             Linux 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

> $PSVersionTable
Name                           Value                                                                                                                                                                                                          
----                           -----                                                                                                                                                                                                          
PSVersion                      6.0.4                                                                                                                                                                                                          
PSEdition                      Core                                                                                                                                                                                                           
GitCommitId                    v6.0.4                                                                                                                                                                                                         
OS                             Linux 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018                                                                                                                                            
Platform                       Unix                                                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                        
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                            
SerializationVersion           1.1.0.1                                                                                                                                                                                                        
WSManStackVersion              3.0    

Just to add as workarounds I have tried using SslProtocol Tls12 without success. And I have also tried: [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 without success.

@iSazonov
Copy link
Collaborator

@hurricanehrndz Could you please check without snap?

@iSazonov iSazonov added Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module labels Sep 10, 2018
@hurricanehrndz
Copy link
Author

hurricanehrndz commented Sep 10, 2018 via email

@iSazonov
Copy link
Collaborator

Please add a reference to the issue in lxd.

@iSazonov iSazonov added the Resolution-External The issue is caused by external component(s). label Sep 10, 2018
@hurricanehrndz
Copy link
Author

hurricanehrndz commented Sep 10, 2018

@iSazonov, I miss spoke when I replied last. I'm sorry please ignore my comment about lxd that was another issue with another project. As you can see from my original post the issue affects both snap version and the normal deb.

@iSazonov iSazonov removed the Resolution-External The issue is caused by external component(s). label Sep 10, 2018
@iSazonov iSazonov reopened this Sep 10, 2018
@iSazonov
Copy link
Collaborator

@SteveL-MSFT Is the Issue important for 6.1 GA?

@SteveL-MSFT
Copy link
Member

I just tried this on 18.04. Starting with (I think), Preview.4 you need to use pwsh-preview with the pre-release versions.

@hurricanehrndz
Copy link
Author

@SteveL-MSFT

Did it work for you? Because I tried with the following snap without success.

summary:   PowerShell for every system!
publisher: Microsoft PowerShell✓
contact:   https://github.com/powershell/powershell
license:   Proprietary
description: |
  PowerShell is an automation and configuration management platform.
  It consists of a cross-platform (Windows, Linux, and macOS)
  command-line shell and associated scripting language.
  
  See https://docs.microsoft.com/en-us/powershell/scripting/powershell-core-support for support
  details.
snap-id: D0A7ph8R6LBXQ8rgs2ad06s8tjyeowsd
channels:                        
  stable:    6.1.0-rc.1 (9) 59MB classic
  candidate: 6.1.0-rc.1 (9) 59MB classic
  beta:      6.1.0-rc.1 (9) 59MB classic
  edge:      6.1.0-rc.1 (9) 59MB classic

@SteveL-MSFT
Copy link
Member

I believe the snap doesn't support pwsh-preview yet. @TravisEz13 ?

@hurricanehrndz
Copy link
Author

hurricanehrndz commented Sep 10, 2018 via email

@TravisEz13
Copy link
Member

Thanks for answering @hurricanehrndz

@TravisEz13
Copy link
Member

I verified the powershell-preview snap works in Ubuntu 18.04 image from multipass

Our snap page links to https://docs.microsoft.com/en-us/powershell/scripting/powershell-core-support?view=powershell-6 which says that 18.04 is not supproted for 6.0, but is for 6.1.

Hope this helps

@hurricanehrndz
Copy link
Author

hurricanehrndz commented Sep 10, 2018

@TravisEz13 so I'm left thinking this is a cisco issue with the ips.

@hurricanehrndz
Copy link
Author

@TravisEz13 ,

you are correct. I tried from home and it seems to work fine. Very interesting. I'm not sure why 6.0.4 did not have this issue with the IPS.

@iSazonov
Copy link
Collaborator

I see nothing that we can fix so close the Issue.

@hurricanehrndz Thanks for your contribution!

@iSazonov iSazonov added the Resolution-Answered The question is answered. label Sep 11, 2018
@iSazonov
Copy link
Collaborator

@hurricanehrndz 6.0.0 is based on .Net Core 2.0 and libcurl. 6.1.0 is based on .Net Core 2.1 and use managed implementation of web client (HttpClient) without libcurl. See https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-2-1 and https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module
Projects
None yet
Development

No branches or pull requests

4 participants