GithubHelp home page GithubHelp logo

sadeghpro / let-s-encrypt-certificate-and-jboss-wildfly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antoniopaolacci/let-s-encrypt-certificate-and-jboss-wildfly

0.0 1.0 0.0 15 KB

Creating/Renewing Let’s Encrypt Certificate JBoss WildFly

let-s-encrypt-certificate-and-jboss-wildfly's Introduction

Let-s-Encrypt-Certificate-and-JBoss-WildFly

Creating/Renewing Let’s Encrypt Certificate JBoss WildFly

Common file related certificate gethttpsforfree.com

If you will have the following PEM-encoded files:

  • cert.pem: Server certificate only
  • chain.pem: Root and intermediate certificates only, Let’s Encrypt chain
  • fullchain.pem: Previous cert.pem and chain.pem combined
  • privkey.pem: Your certificate's private key (do not share this with anyone)

Download the certbot-auto script

cd /home/utente
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x certbot-auto

Now that certbot is hopefully installed, we need to ask it to create/renew certificate.

  • certbot-auto renew
  • certbot-auto certonly --standalone --standalone-supported-challenges http-01 --agree-tos --rsa-key-size 4096 --renew-by-default --email [email protected] -d example.com -d www.example.com

At the end, the command show somethings like this:

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/***/fullchain.pem. Your cert will
expire on ***. To obtain a new or tweaked version of this
certificate in the future, simply run certbot-auto again. To
non-interactively renew *all* of your certificates, run
"certbot-auto renew"
- If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

We need to get the public and private keys into Wildfly. Instead of (Apache, Nginx) was setup with the public and private keys pointed to separately, but Wildfly (generally, Java) works off of a keystore. We need to convert the PEM file into a P12 file that is readable by the keytool.

openssl pkcs12 -export -in /etc/letsencrypt/live/YOURDOMAIN/fullchain.pem -inkey /etc/letsencrypt/live/YOURDOMAIN/privkey.pem -out KEYSTORENAME.p12 -name KEYSTOREALIAS

YOURDOMAIN replacement is the folder corresponding to the domain that you’re generating the key for, and was present in the listed output from the previous step.

KEYSTORENAME will become part of the generated file name, and will be used in the WildFly xml of configuration, as will the KEYSTOREALIAS.

Once you’ve pressed enter, you’ll be prompted (and verified) for a new password. This new password will be used in a moment when we generate the keystore. (called it PREVIOUSPASSWORD)

Generating the keystore java (.jks)

/usr/lib/jvm/jdk1.7.0_80/bin/keytool -importkeystore -deststorepass WILDFLY_NEW_STORE_PASS -destkeypass WILDFLY_NEW_KEY_PASS -destkeystore NEW_KEYSTORE_FILE.jks -srckeystore KEYSTORENAME.p12 -srcstoretype PKCS12 -srcstorepass PREVIOUSPASSWORD -alias KEYSTOREALIAS
sudo cp NEW_KEYSTORE_FILE.jks /opt/wildfly/standalone/configuration/

Find the section and specifically the one you’re setting up

<server-identities>
   <ssl>
      <keystore path="NEW_KEYSTORE_FILE.jks" 
                relative-to="jboss.server.config.dir" 
                keystore-password="WILDFLY_NEW_STORE_PASS" 
                alias="KEYSTOREALIAS" 
                key-password="WILDFLY_NEW_KEY_PASS"/>
   </ssl>
</server-identities>

Start the application server

service wildfly start

let-s-encrypt-certificate-and-jboss-wildfly's People

Contributors

antoniopaolacci avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.