Proxy authentication from Ubuntu 24.04. fails for Install-PSResource with error code 407
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 28/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- docker, powershell, ubuntu
- Domínio
- authentication, infrastructure, networking
Direção de pesquisa
Comece reproduzindo o comando docker run com a variável de ambiente do proxy na imagem preview-ubuntu-24.04 e, em seguida, compare-o com as imagens Ubuntu 22.04 e Alpine 3.20. Investigue o comportamento do proxy NTLM descrito nas issues vinculadas de dotnet/runtime; considera-se concluído quando Install-PSResource -Name Az for executado com sucesso por meio do proxy autenticado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest image.
- Search the existing issues.
- Verified that this is not a Known Issue
- Verified this is not an issues in the underlying windows container that should be reported to Windows Feedback Hub
Steps to reproduce
Under powershell:preview-ubuntu-24.04, we cannot get NTLM authentication with our HTTP(S) proxy to work. Therefore, we cannot install PowerShell modules. We supply the proxy credentials via en environment variable (which seems to be picked up).
docker run -e ALL_PROXY="http://<username>:<pw>@<proxyfqdn>:8080" --rm --name pwsh -it mcr.microsoft.com/powershell:preview-ubuntu-24.04
I believe we are hitting https://github.com/dotnet/runtime/issues/100231. Our Wireshark capture shows a first CONNECT to the proxy to be initiated without authentication. A second CONNECT is initiated with a Proxy-Authorization header, but that still returns 407.
The Ubuntu 22.04 and Alpine 3.20 images behave differently, there the second CONNECT message is not send at all. I believe these hit NTLM authentication not working in Linux based environment · Issue #101058 · dotnet/runtime instead.
Proxy authentication under Windows works.
Expected behavior
Az Module is installed.
Actual behavior
PS /> [System.Net.Http.HttpClient]::DefaultProxy
Credentials
-----------
System.Net.Http.HttpEnvironmentProxyCredentials
PS /> Install-PSResource -Name Az -Scope CurrentUser
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its Trusted value by running the Set-PSResourceRepository cmdlet. Are you sure you want to install the
PSResource from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
Install-PSResource: 'The proxy tunnel request to proxy 'http://<user>:<pw>@<proxyfqdn>:8080/' failed with status code '407'."' Request sent: 'https://www.powershellgallery.com/api/v2/FindPackagesById()?%24filter=Id+eq+%27Az%27+and+IsLatestVersion+eq+true&%24inlinecount=allpages&id=%27Az%27'
Install-PSResource: Package(s) 'Az' could not be installed from repository 'PSGallery'.
Error details
PS /> Get-Error
Exception :
Type : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
Message : Package(s) 'Az' could not be installed from repository 'PSGallery'.
HResult : -2146233088
TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
CategoryInfo : InvalidData: (Microsoft.PowerShel…s.InstallPSResource:InstallPSResource) [Install-PSResource], ResourceNotFoundException
FullyQualifiedErrorId : InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
InvocationInfo :
MyCommand : Install-PSResource
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 3
Line : Install-PSResource -Name Az -Scope CurrentUser
Statement : Install-PSResource -Name Az -Scope CurrentUser
PositionMessage : At line:1 char:1
+ Install-PSResource -Name Az -Scope CurrentUser
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Install-PSResource
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
0
1
Environment data
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 5572,
"digest": "sha256:ca17b51e4e0fbd04c97c1a6ee9109a505c425f63a8c9ca1b80a6c908035a74c5"
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 29751968,
"digest": "sha256:de44b265507ae44b212defcb50694d666f136b35c1090d9709068bc861bb2d64"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 103040902,
"digest": "sha256:94058be39bdeb7bdadb5c92c6d989191e021a35d7d7a24d27f5fbe1cce3439d6"
}
]
}
Visuals
No response
- Linguagem predominante
- Dockerfile
- Estrelas
- 449
- Forks
- 158
- Merge médio
- 3d 10h
- PRs com merge (30d)
- 1
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/PowerShell-Docker
-
Git AbertaIssue-Enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
PowerShell/PowerShell-Docker#857 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
PowerShell/PowerShell-Docker#856 · 2 comentários · 1 reação ·
-
Issue-Enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 48/100
PowerShell/PowerShell-Docker#854 ·
-
Issue-Enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
PowerShell/PowerShell-Docker#853 · 6 comentários · 17 reações ·
-
Issue-Enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
PowerShell/PowerShell-Docker#851 · 2 comentários · 2 reações ·
Todas as issues de PowerShell/PowerShell-Docker
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
corazawaf/coraza-nginx#140 ·
-
documentation help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
clerk/javascript#9852 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
AiursoftWeb/AnduinOS-2#19 ·