Created
October 28, 2017 15:19
-
-
Save aelkz/c392cc0f9cac2ac63cc8195984fd11fc to your computer and use it in GitHub Desktop.
JBoss EAP / Wildfly: self-signed certificate creation to enable security connection.
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
#!/bin/bash | |
export PW='98p@R3dH4t777' | |
# ------------------------------------------------------------------------------------- | |
# JBoss (Wildfly) RSA self-signed certificate for using with secure connections | |
# ------------------------------------------------------------------------------------- | |
# docs: https://docs.oracle.com/javase/7/docs/technotes/tools/solaris/keytool.html | |
# https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/6/html/administration_and_configuration_guide/generate_a_ssl_encryption_key_and_certificate | |
# https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html-single/how_to_configure_server_security/ | |
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-ssh-configuration-keypairs.html | |
# ------------------------------------------------------------------------------------- | |
# create a java self-signed certificate to enable secure connection | |
# RSA key | |
echo '1: creating a self-signed certificate' | |
keytool -v -genkeypair \ | |
-alias appserver \ | |
-keyalg RSA \ | |
-storetype jks \ | |
-storepass:env PW \ | |
-keypass:env PW \ | |
-keysize 2048 \ | |
-keystore /opt/domain/identity.jks | |
# expected result: Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 90 days | |
echo 'final: self-signed certificate successful created' | |
# EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment