-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Dex SSO failing with "http: server gave HTTP response to HTTPS client" #9998
Comments
I bet it was GHSA-7943-82jg-wmw5. #9424 wasn't (and won't be) backported to 2.4. Have you set |
Thanks very much for having a look @crenshaw-dev The
I did try setting |
Thanks to @crenshaw-dev we appear to be up and running again with doing the following:
|
@ab-arao It's interesting that you had to set that. It should be the default: https://github.com/argoproj/argo-cd/blob/release-2.4/common/common.go#L17 The OIDC client in Argo CD's "session manager" includes a URL rewriter - each OIDC request to https://argocd.example.com/api/dex/* actually ends up being sent to the address at Since somehow the schema in that rewritten URL ended up being HTTPS, and Dex currently only serves HTTP, you got the above error. How the heck that schema got rewritten to be https instead of http, I have no idea. At any rate, glad you got it working! |
This started happening again just now. The command params configmap still shows the http dex server:
I'm trying to identify if something else has changed today or over the weekend. |
This is very very weird. I've seen one other case where the Dex URL seemed to change with no reason (in that case, the hostname changed as well, not just the schema). The URL is set when the dex round tripper is created, which happens when the session manager is created, which happens when the server is created by the CLI. The CLI gets the Dex address from the As far as I can tell, nothing mutates the rewrite URL. Are you getting the error with the UI each time, or are you now seeing it on the CLI? |
Thanks for your fast response again @crenshaw-dev, really appreciate it. We are getting the error in the UI as well as the CLI:
|
The function I keep returning to when trying to step through the code here is this: Line 126 in a2a6d9d
That function is referenced in several places. I can't tell if it would be possible for there to be some kind of condition in that results in the string being returned with The condition would be the result of there being inconsistent access to the command line parameters config map or something like that. |
My bad, some of my links were to the latest code. Here's the file for the version you're running: https://github.com/argoproj/argo-cd/blob/v2.4.0/util/dex/dex.go The http/https switch is new for 2.5. It should always be http in your version. |
I turned on some kind of SSO debugging using the
Based on searching that initial log message, it looks like the provider is failing to initialize as a result of this line failing: Line 62 in 62a6c7a
This file talks about lazy-loading the provider configuration in order to avoid a chicken-and-egg problem, which it seems like might be happening here. Is it possible to edit the Or would setting the |
If I change the
In contrast, before when
And setting the
The settings being passed into Line 63 in 62a6c7a
|
Continuing to play with configuration permutations, I tried setting both the This resulted in me being able to log in using SSO, except there was some strange behavior:
What is even more interesting is that now this login process works regardless of whether the The login works through the cli as well. I notice that we are now on a different version of argocd server:
Now we are on We are in a better state than at the start of the day because we can log in again, but I'd appreciate any guidance on how we can restore the normal SSO login flow and keep it stable. |
Yeah, that makes no sense to me, because the OIDC client should be using whatever schema is set in Apologies for the slow response, coming back to this tomorrow. |
We updated again and I had to run through the restart dance to restore the janky login. Current version:
What appears to work is the following:
Then it is possible to log in with the following steps as before:
|
I don't follow the last two. What does it mean to navigate to https://? Looks like you're already redirected to an https:// URL. |
@crenshaw-dev sorry, the formatting got messed up for some reason. Basically the redirect does not result in the argocd ui being loaded. Instead we see a page that just shows the jwt token from our IdP. However, the redirect does add the correct cookie, so if we rewrite the url in the browser to being the argocd homepage we are able to log in. |
I use the official argo-cd Helm chart to deploy the application and recently started having this same error being reported here after upgrading to argo-cd:
params:
dexserver.disable.tls: true This ensured all future deployments of the Helm chart forced apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cmd-params-cm
data:
<-- data omitted for brevity -- >
dexserver.disable.tls: "true"
server.dex.server: http://release-name-argocd-dex-server:5556
server.dex.server.strict.tls: "false"
<-- data omitted for brevity -- > I hope this helps someone if they stumble upon this issue and are using the official Helm chart. |
If you are using Argo CD <v2.5.0, then @tonedefdev's solution above is acceptable. But please make a note that when you upgrade to >=v2.5.0, you should remove these settings to take advantage of HTTPS communication between the API server and Dex. If you are using Argo CD >=v2.5.0, please do not disable TLS as a fix for this error message. TLS support was added because it is a very important security mechanism for a very sensitive communication channel. This error message occurs for one of two reasons. Either:
This configuration mismatch is a solveable problem, and it should be solved by identifying the mismatch rather than hacked around by making things less secure. A common configuration mismatch is when folks manually set There are a thousand other possible ways to produce a mismatch, so I can't enumerate the solutions here. @tonedefdev found a valid solution was manually disabling TLS. This is valid, because their version of Argo CD does not support TLS communication between the API server and Dex. But if they were using 2.5.0+, they would need to dig deeper to find the config mismatch. |
I also have this problem. I have keycloak behind ingress with cert manager lets encrypt I tried event to publish argocd-dex server behind ingress https with letsencrypt and configure it in argocd config map, but it does not work |
Checklist:
argocd version
.Describe the bug
Receiving following error message when trying to login with SSO to argocd:
I'm wondering if it could be related to any of the following recent changes:
We are using the bundled dex instance.
I've tried changing the
oidc.tls.insecure.skip.verify
setting to true as suggested but haven't seen any improvement. I'm considering pinning all the container images to 2.4.4 in the cluster but wanted to see if anyone else was seeing this or had thoughts first.To Reproduce
We see this error whenever we click on the SSO login button in the UI.
Expected behavior
Login should occur.
Version
We do not have the default admin login turned on and because our CLI login uses SSO, I'm not able to get the actual output.However our manifests are configured to use thelatest
version of argocd and so I would think we are on2.4.5
or2.4.6
.Updated version info after getting SSO working again with the changes below
Logs
Unable to find any relevant logs.
The text was updated successfully, but these errors were encountered: