Skip to content

Commit

Permalink
use issuer_type for prodCA cert fetch
Browse files Browse the repository at this point in the history
Reviewed By: abakiaydin

Differential Revision: D64119325

fbshipit-source-id: 78f8a96afffadd0a7fd1160f07e8651d3a77a0d3
  • Loading branch information
Rachana Nandan authored and facebook-github-bot committed Oct 31, 2024
1 parent 744d6a1 commit 1fc174e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wangle/acceptor/ServerSocketConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct ServerSocketConfig {

bool hasProdCASignedCert() const {
for (const auto& cfg : sslContextConfigs) {
if (cfg.isProdCASigned) {
if (cfg.shouldLoadFromProdCA) {
return true;
}
}
Expand Down
13 changes: 11 additions & 2 deletions wangle/ssl/SSLContextConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct SSLContextConfig {
bool isBuffer{false};
};

enum IssuerType { PUBLIC_CA, PROD_CA, PUBLIC_TO_PRODCA };
/*
* If using a delegated credential, in this case we expect
* a combined pem. Also we expect the key here to refer to the
Expand Down Expand Up @@ -175,8 +176,16 @@ struct SSLContextConfig {
// Load cert-key pairs corresponding to these domains
std::vector<std::string> domains;

// If true, the certs for this domain is signed by our internal CA
bool isProdCASigned{false};
// This field is utilized in the origin tiers for the migration remaining
// Public cert usgae to our internal CA.
// If true, prefer to fetch an EC cert firectly from ProdCA.
// If false, or cert fetch failed, fallback to certs provided by Cryptossl
// Note: cryptossl may provide both RSA and EC cert for a given domain
bool shouldLoadFromProdCA{false};

// This value is used by the cert offload flow.
// Default to public cert (fetched from cryptossl)
IssuerType issuerType{IssuerType::PUBLIC_CA};

// A namespace to use for sessions generated from this context so that
// they will not be shared between other sessions generated from the
Expand Down

0 comments on commit 1fc174e

Please sign in to comment.