Giter Site home page Giter Site logo

runabol / spring-boot-starter-acme Goto Github PK

View Code? Open in Web Editor NEW
99.0 7.0 16.0 84 KB

Generate SSL certs easily for Spring Boot apps

License: Apache License 2.0

Shell 18.88% Batchfile 14.58% Java 66.54%
spring-boot ssl ssl-certificate acme apache2

spring-boot-starter-acme's Introduction

Spring Boot Starter ACME

A Spring Boot module that is meant to ease the pain of generating a valid SSL Certificate using the Automatic Certificate Management Environment (ACME) protocol.

This project depends on the acme4j library.

Dependencies

This module depends on having openssl on the PATH to convert the certificate to PKCS12 format.

Maven

<dependency>
  <groupId>com.creactiviti</groupId>
  <artifactId>spring-boot-starter-acme</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

<repositories>
   <repository>
      <id>maven-snapshots</id>
      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
      <layout>default</layout>
      <releases>
         <enabled>false</enabled>
      </releases>
      <snapshots>
         <enabled>true</enabled>
      </snapshots>
   </repository>
</repositories>

Usage

  1. Add the module to your pom.xml file as a dependency.

  2. Build your project.

  3. Deploy it to a target machine and point your domain name to the IP address of that machine. LetsEncrypt validates your ownership of the domain by making a callback to the http://your-domain/.well-known/acme-challenge/{token} endpoint exposed by this module.

  4. Make sure that your server has openssl available on its $PATH.

  5. To activate spring-boot-starter-acme and generate a certificate execute:

sudo java -Dserver.port=80 -Dacme.enabled=true -Dacme.domain-name=<YOUR_DOMAIN_NAME> -Dacme.accept-terms-of-service=true -jar mysecureapp-0.0.1-SNAPSHOT.jar
  1. Check your console for a confirmation that the certificate was successfully generated.

  2. Stop your application and configure it to make use of the generated certificate:

server.port=443
server.ssl.key-store=keystore.p12
server.ssl.key-store-password=password
server.ssl.keyStoreType=PKCS12

Configuration

Name Description Type Default Value
acme.enabled Activate the spring-boot-starter-acme module boolean false
acme.accept-terms-of-service Accepts the CA's terms of service boolean false
acme.domain-name The domain name to register the SSL cert for string
acme.user-key-file The location of the user private key file string user.key
acme.domain-key-file The location of the domain private key file string domain.key
acme.domain-csr-file The location of the domain csr file string domain.csr
acme.domain-chain-file The location of the domain chain file string domain-chain.crt
acme.key-store-file The location of the keystore file string keystore.p12
acme.key-store-password The keystore password string password
acme.endpoint The acme endpoint to generate the cert with string acme://letsencrypt.org

Endpoints

CA Env URL
LetsEncrypt Staging acme://letsencrypt.org/staging
LetsEncrypt Prod acme://letsencrypt.org

License

Version 2.0 of the Apache License.

spring-boot-starter-acme's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-starter-acme's Issues

Plugin does not support ACME v2

When I tried to run the command below:
java -Dserver.port=80 -Dacme.enabled=true -Dacme.domain-name=localhost -Dacme.accept-terms-of-service=true -jar myapplication.jar

I got this error:

Caused by: org.shredzone.acme4j.exception.AcmeUnauthorizedException: Account creation on ACMEv1 is disabled. Please upgrade your ACME client to a version that supports ACMEv2 / RFC 8555. See https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430 for details. at org.shredzone.acme4j.connector.DefaultConnection.createAcmeException(DefaultConnection.java:397) at org.shredzone.acme4j.connector.DefaultConnection.accept(DefaultConnection.java:207) at org.shredzone.acme4j.RegistrationBuilder.create(RegistrationBuilder.java:88) at com.creactiviti.spring.boot.starter.acme.CertGenerator.getOrCreateAccount(CertGenerator.java:158) at com.creactiviti.spring.boot.starter.acme.CertGenerator.generate(CertGenerator.java:72) at com.creactiviti.spring.boot.starter.acme.AcmeEncryptRunner.run(AcmeEncryptRunner.java:40) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:813) ... 13 common frames omitted

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.