codex - 💡(How to fix) Fix Windows sandbox HTTPS via Schannel fails with `SEC_E_NO_CREDENTIALS` [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17459Fetched 2026-04-12 13:28:24
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1unlabeled ×1

On Windows, HTTPS requests that use the Windows TLS stack (Schannel) fail inside the current sandboxed shell with:

  • PowerShell / .NET: Authentication failed, see inner exception
  • inner Win32 error: SEC_E_NO_CREDENTIALS (0x8009030e)
  • curl.exe (Schannel build): schannel: AcquireCredentialsHandle failed

At the same time:

  • Python HTTPS works in the same sandbox
  • the same PowerShell HTTPS call works outside the sandbox
  • sandbox users can do Schannel HTTPS successfully after their profiles are initialized

I started investigating sandbox-user profile initialization because the Schannel failure was SEC_E_NO_CREDENTIALS, which strongly suggested missing or inaccessible per-user Windows state. The fact that the sandbox users initially had no profile directories made that look like a credible lead.

Related issue: #17458 ("Windows sandbox users are created but their profiles are not initialized until manual first logon").

Error Message

The SSL connection could not be established, see inner exception. Authentication failed, see inner exception. SEC_E_NO_CREDENTIALS (0x8009030e)

Root Cause

I started investigating sandbox-user profile initialization because the Schannel failure was SEC_E_NO_CREDENTIALS, which strongly suggested missing or inaccessible per-user Windows state. The fact that the sandbox users initially had no profile directories made that look like a credible lead.

Code Example

Invoke-WebRequest -UseBasicParsing -Uri 'https://api.ipify.org'

---

The SSL connection could not be established, see inner exception.
Authentication failed, see inner exception.
SEC_E_NO_CREDENTIALS (0x8009030e)

---

$tcp = [System.Net.Sockets.TcpClient]::new('api.ipify.org',443)
$ssl = [System.Net.Security.SslStream]::new($tcp.GetStream(), $false, ({$true}))
$ssl.AuthenticateAsClient('api.ipify.org')

---

curl: (35) schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS

---

whoami
Invoke-WebRequest -UseBasicParsing -Uri 'https://api.ipify.org'
curl.exe https://api.ipify.org

---

{
  "code": "helper_firewall_rule_create_or_add_failed",
  "message": "SetRemotePorts failed: Error { code: HRESULT(0x80070057), message: \"Параметр задан неверно.\" }"
}
RAW_BUFFERClick to expand / collapse

Summary

On Windows, HTTPS requests that use the Windows TLS stack (Schannel) fail inside the current sandboxed shell with:

  • PowerShell / .NET: Authentication failed, see inner exception
  • inner Win32 error: SEC_E_NO_CREDENTIALS (0x8009030e)
  • curl.exe (Schannel build): schannel: AcquireCredentialsHandle failed

At the same time:

  • Python HTTPS works in the same sandbox
  • the same PowerShell HTTPS call works outside the sandbox
  • sandbox users can do Schannel HTTPS successfully after their profiles are initialized

I started investigating sandbox-user profile initialization because the Schannel failure was SEC_E_NO_CREDENTIALS, which strongly suggested missing or inaccessible per-user Windows state. The fact that the sandbox users initially had no profile directories made that look like a credible lead.

Related issue: #17458 ("Windows sandbox users are created but their profiles are not initialized until manual first logon").

Version / platform

  • Date observed: April 11, 2026
  • Platform: Windows 11 / Windows 10.0.26200
  • PowerShell: 7.5.5
  • curl.exe: 8.18.0 with Schannel

Failing behavior

Inside the sandboxed shell:

Invoke-WebRequest -UseBasicParsing -Uri 'https://api.ipify.org'

fails with:

The SSL connection could not be established, see inner exception.
Authentication failed, see inner exception.
SEC_E_NO_CREDENTIALS (0x8009030e)

Raw .NET TLS fails too:

$tcp = [System.Net.Sockets.TcpClient]::new('api.ipify.org',443)
$ssl = [System.Net.Security.SslStream]::new($tcp.GetStream(), $false, ({$true}))
$ssl.AuthenticateAsClient('api.ipify.org')

and curl.exe fails with:

curl: (35) schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS

What works

  • Python HTTPS in the same sandbox
  • raw TCP connectivity to port 443
  • PowerShell HTTPS outside the sandbox
  • Schannel HTTPS when run manually as CodexSandboxOnline after profile creation
  • Schannel HTTPS when run manually as CodexSandboxOffline after profile creation

Important observations

1. The failing current sandboxed shell is running as the real user

Inside the failing shell:

  • whoami -> ELIOT-PC2\Eliot
  • USERPROFILE -> C:\Users\Eliot

So the failing shell appears to be a restricted real-user context, not an actual dedicated sandbox-user process.

2. Dedicated sandbox users succeed after profile creation

After manually forcing first logon for:

  • CodexSandboxOnline
  • CodexSandboxOffline

both can do:

  • PowerShell HTTPS
  • raw .NET SslStream
  • curl.exe HTTPS

successfully.

That manual profile initialization is tracked separately in #17458.

3. There is also an env inheritance bug

In those sandbox-user sessions, env is still inherited from the real user:

  • USERNAME=Eliot
  • USERPROFILE=C:\Users\Eliot
  • APPDATA=C:\Users\Eliot\AppData\Roaming
  • LOCALAPPDATA=C:\Users\Eliot\AppData\Local
  • TEMP/TMP=C:\Users\Eliot\AppData\Local\Temp

That looks like a real bug in the elevated Windows sandbox path, but it is not sufficient by itself to explain the Schannel failure, because the sandbox users still succeed despite the wrong env.

Why this looks like a sandbox-specific Schannel issue

The failure is specific to the Windows TLS stack:

  • PowerShell / .NET / Schannel curl.exe fail
  • Python HTTPS succeeds

That points to a Schannel / SSPI / token / user-profile interaction, not general network failure.

Repro

Inside sandbox:

whoami
Invoke-WebRequest -UseBasicParsing -Uri 'https://api.ipify.org'
curl.exe https://api.ipify.org

Observed:

  • whoami = real user
  • Schannel HTTPS fails with SEC_E_NO_CREDENTIALS

Outside sandbox, the same PowerShell HTTPS call succeeds.

Expected behavior

HTTPS requests using Schannel should work in the Windows sandbox when network access is allowed.

Actual behavior

Schannel HTTPS fails in the current sandboxed shell with SEC_E_NO_CREDENTIALS.

Related issue discovered during investigation

The offline firewall setup also appears broken:

setup_error.json contains:

{
  "code": "helper_firewall_rule_create_or_add_failed",
  "message": "SetRemotePorts failed: Error { code: HRESULT(0x80070057), message: \"Параметр задан неверно.\" }"
}

That may be a separate Windows sandbox bug.

Suggested investigation areas

  1. Determine whether the active Windows shell sandbox path is using:
    • dedicated sandbox users
    • or a restricted-token-on-real-user path
  2. Compare the failing shell token/context with the successful CodexSandboxOnline / CodexSandboxOffline sessions.
  3. Investigate what Schannel/SSPI state is missing in the restricted real-user sandbox context.
  4. Separately fix the incorrect env inheritance in the elevated sandbox path.
  5. Consider whether #17458 is a prerequisite or partial trigger for this issue, even if it is not the full root cause.

extent analysis

TL;DR

Initialize the user profile for the sandbox user to enable Schannel HTTPS requests.

Guidance

  • Investigate the difference in Schannel/SSPI state between the failing shell token/context and the successful CodexSandboxOnline / CodexSandboxOffline sessions.
  • Compare the security tokens and credentials available in both scenarios to identify the missing component.
  • Consider initializing the user profile for the sandbox user, as this seems to resolve the issue for CodexSandboxOnline and CodexSandboxOffline.
  • Review the related issue #17458 to determine if it is a prerequisite or partial trigger for this issue.

Example

No code snippet is provided as the issue is more related to the configuration and setup of the sandbox environment.

Notes

The issue seems to be specific to the Windows TLS stack and the sandbox environment. The fact that Python HTTPS works in the same sandbox suggests that the issue is not with the network connectivity but rather with the Schannel configuration or the user profile initialization.

Recommendation

Apply a workaround by initializing the user profile for the sandbox user, as this seems to resolve the issue for CodexSandboxOnline and CodexSandboxOffline. This is because the initialization of the user profile seems to provide the necessary Schannel/SSPI state for HTTPS requests to work.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

HTTPS requests using Schannel should work in the Windows sandbox when network access is allowed.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING