mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Add web WHOIS redirect support
Opened two ports (30010 and 30011 by default) that handles HTTP(S) GET requests. the HTTP request is redirected to the corresponding HTTPS site, whereas the HTTPS request is redirected to a site that supports web WHOIS. The GCLB currently exposes port 80, but not port 443 on its TCP proxy load balancer (see https://cloud.google.com/load-balancing/docs/choosing-load-balancer). As a result, the HTTP traffic has to be routed by the HTTP load balancer, which requires a separate HTTP health check (as opposed to the TCP health check that the TCP proxy LB uses). This CL also added support for HTTP health check. There is not a strong case for adding an end-to-end test for WebWhoisProtocolsModule (like those for EppProtocolModule, etc) as it just assembles standard HTTP codecs used for an HTTP server, plus the WebWhoisRedirectHandler, which is tested. The end-to-end test would just be testing if the Netty provided HTTP handlers correctly parse raw HTTP messages. Sever other small improvement is also included: [1] Use setInt other than set when setting content length in HTTP headers. I don't think it is necessary, but it is nevertheless a better practice to use a more specialized setter. [2] Do not write metrics when running locally. [3] Rename the qualifier @EppCertificates to @ServerSertificate as it now provides the certificate used in HTTPS traffic as well. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=206944843
This commit is contained in:
parent
f614044681
commit
4a5b317016
18 changed files with 686 additions and 97 deletions
|
@ -44,7 +44,7 @@ import org.bouncycastle.openssl.PEMParser;
|
|||
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
|
||||
|
||||
/**
|
||||
* Dagger module that provides bindings needed to inject EPP SSL certificate chain and private key.
|
||||
* Dagger module that provides bindings needed to inject server certificate chain and private key.
|
||||
*
|
||||
* <p>The production certificates and private key are stored in a .pem file that is encrypted by
|
||||
* Cloud KMS. The .pem file can be generated by concatenating the .crt certificate files on the
|
||||
|
@ -60,17 +60,22 @@ import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
|
|||
@Module
|
||||
public class CertificateModule {
|
||||
|
||||
/** Dagger qualifier to provide bindings related to EPP certificates */
|
||||
/** Dagger qualifier to provide bindings related to the certificates that the server provides. */
|
||||
@Qualifier
|
||||
public @interface EppCertificates {}
|
||||
@interface ServerCertificates {}
|
||||
|
||||
/** Dagger qualifier to provide bindings when running locally. */
|
||||
@Qualifier
|
||||
public @interface Local {}
|
||||
@interface Local {}
|
||||
|
||||
/** Dagger qualifier to provide bindings when running in production. */
|
||||
/**
|
||||
* Dagger qualifier to provide bindings when running in production.
|
||||
*
|
||||
* <p>The "production" here means that the proxy runs on GKE, as apposed to on a local machine. It
|
||||
* does not necessary mean the production environment.
|
||||
*/
|
||||
@Qualifier
|
||||
public @interface Prod {}
|
||||
@interface Prod {}
|
||||
|
||||
static {
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
|
@ -95,7 +100,7 @@ public class CertificateModule {
|
|||
|
||||
@Singleton
|
||||
@Provides
|
||||
@EppCertificates
|
||||
@ServerCertificates
|
||||
static X509Certificate[] provideCertificates(
|
||||
Environment env,
|
||||
@Local Lazy<X509Certificate[]> localCertificates,
|
||||
|
@ -105,7 +110,7 @@ public class CertificateModule {
|
|||
|
||||
@Singleton
|
||||
@Provides
|
||||
@EppCertificates
|
||||
@ServerCertificates
|
||||
static PrivateKey providePrivateKey(
|
||||
Environment env,
|
||||
@Local Lazy<PrivateKey> localPrivateKey,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue