wslu icon indicating copy to clipboard operation
wslu copied to clipboard

wslview not openeing links with limited access

Open marcinbjorn opened this issue 1 year ago • 5 comments

Windows Version

Windows 10

Windows Build Number

19044

WSL Version

WSL 2

Distro Version

Ubuntu 20.04

WSL Utilities Version

4.1.1

Describe the bug

I'm trying to open websites with access control list limited only to few public IPs. I'm getting this error

wslview http://210.210.210.210
Start : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:128
+ ... ystem.Text.Encoding]::GetEncoding(850); Start "http\210.210.210.210"
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Edit: Made temporary fix by commenting out body of function url_validator (line 461) and return 0

Edit2: Found what was the issue, curl fail with error curl: (60) SSL certificate problem: self signed certificate flag --insecure solves issue

function url_validator {
 content=$(curl --head --insecure --silent "$*" | head -n 1)
 if [ -n "$content" ]; then
    return 0
 else
    return 1
 fi
}

Websites that I'm accessing have very high latency, in my case curling takes extra 1-2 seconds, I'm rather skip validation at all

Steps to Reproduce

wslview [ not existing website ]

Expected behavior

Whenever wslview sees http:// or https:// at the beginning of link it should trust user and open link without verifying it.

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

marcinbjorn avatar Mar 03 '23 11:03 marcinbjorn