Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

CNAMEs and HTTPS certificates #167

Open
ojongerius opened this issue May 16, 2018 · 7 comments
Open

CNAMEs and HTTPS certificates #167

ojongerius opened this issue May 16, 2018 · 7 comments
Labels

Comments

@ojongerius
Copy link
Contributor

api-stage works, but https fails: https://api-stage.freecodecamp.org/stage/api

api-stage.freecodecamp.org uses an unsupported protocol.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH```
@ojongerius ojongerius changed the title Sort out CNAMEs and HTTPS certificates CNAMEs and HTTPS certificates May 16, 2018
@raisedadead
Copy link
Member

I think there a couple issues here.

  1. We need to toggle the traffic to directly reach the endpoint without passing though it. This is because the SSL Cert is shared among our other entities.

    The fix in that case is simply, toggle the orange cloud thing besides the entry for the CNAME

  2. Double check CNAME flattening, but I think that needs to be investigated after 1. is taken care off.

@Bouncey
Copy link
Member

Bouncey commented May 16, 2018

cname

@ojongerius
Copy link
Contributor Author

Same deal.

I have good experience with https://aws.amazon.com/certificate-manager . I see they support importing third-party-certificates. We can either import certificates in to certificate manager or create a new one (it's free).

@ojongerius
Copy link
Contributor Author

While we are at it, can we update the CNAME? I've deployed stage to the freeCodeCamp account and the URL is now: https://hxtsoafqna.execute-api.us-east-1.amazonaws.com

@raisedadead
Copy link
Member

raisedadead commented May 17, 2018

@ojongerius that is the intent. @Bouncey has confirmed that the traffic is not going through CloudFlare, it would need a SSL cert.

One can be created using any method that is suitable. Will you be able to do that using the certificate-manager? Would it need domain verification records (TXT), etc.?

If that is the case, we should just do this over a call with @freeCodeCamp/open-api It will just be faster that way.

@Bouncey
Copy link
Member

Bouncey commented May 17, 2018

CNAME updated.

If we send the traffic through cloudflare would it not pick up our https cert? Do we not want this?

@raisedadead
Copy link
Member

raisedadead commented May 17, 2018

If we send the traffic through cloudflare would it not pick up our https cert? Do we not want this?

If we send traffic trough CF, then the cert used would be of the ones provided by CF. But since the actual API end point is having a default cert of its own (even when we do not give it one), there is a mismatch.

In that case, it should just directly hit the API as it is bypassing CF.

But this also fails, because we are using a CNAME for the API, which CF flattens out.

So, we need to install a SSL cert at the endpoint.
This SSL cert should cover the intended final domain api-stage.freecodecamp.org & api.freecodecamp.org for that matter.

This way after we bypass the CF, and hit the endpoint with our CNAME (flattened) domain, it resolves correctly, because the client sees that the domain is matching the cert (installed at the endpoint)

Hope this clarifies?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants