forked from zegelin/cassandra-exporter
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #52
- Loading branch information
Showing
25 changed files
with
1,374 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ dependency-reduced-pom.xml | |
*.releaseBackup | ||
release.properties | ||
|
||
*.srl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
RESOURCE_PATH="common/src/test/resources" | ||
|
||
# Generate a private key and store it both unecrypted and encrypted (password protected) | ||
# Create a self-signed certificate for the key | ||
mkdir -p ${RESOURCE_PATH}/cert | ||
rm -f ${RESOURCE_PATH}/cert/* | ||
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform PEM -out ${RESOURCE_PATH}/cert/key.pem | ||
echo -n "password" > ${RESOURCE_PATH}/cert/protected-key.pass | ||
openssl pkcs8 -topk8 -v1 PBE-SHA1-RC4-128 -in ${RESOURCE_PATH}/cert/key.pem -out ${RESOURCE_PATH}/cert/protected-key.pem -passout file:${RESOURCE_PATH}/cert/protected-key.pass | ||
openssl req -x509 -new -key ${RESOURCE_PATH}/cert/key.pem -sha256 -days 10000 -out ${RESOURCE_PATH}/cert/cert.pem -subj '/CN=localhost/O=Example Company/C=SE' -nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
common/src/main/java/com/zegelin/cassandra/exporter/netty/ssl/ClientAuthentication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.zegelin.cassandra.exporter.netty.ssl; | ||
|
||
import io.netty.handler.ssl.ClientAuth; | ||
|
||
public enum ClientAuthentication { | ||
NONE(ClientAuth.NONE, false), | ||
OPTIONAL(ClientAuth.OPTIONAL, false), | ||
REQUIRE(ClientAuth.REQUIRE, false), | ||
VALIDATE(ClientAuth.REQUIRE, true); | ||
|
||
private final ClientAuth clientAuth; | ||
private final boolean hostnameValidation; | ||
|
||
ClientAuthentication(final ClientAuth clientAuth, final boolean hostnameValidation) { | ||
this.clientAuth = clientAuth; | ||
this.hostnameValidation = hostnameValidation; | ||
} | ||
|
||
ClientAuth getClientAuth() { | ||
return clientAuth; | ||
} | ||
|
||
boolean getHostnameValidation() { | ||
return hostnameValidation; | ||
} | ||
} |
Oops, something went wrong.