Created
October 10, 2017 23:15
-
-
Save gp187/b99a0e98336a69c28f77e64aa65d49fb to your computer and use it in GitHub Desktop.
How to make Gradle work with Letsencrypt certificates in Nexus
This file contains hidden or 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/sh | |
# Download the certificate you need from the website | |
openssl s_client -connect my-nexus-website.com:443 > www.crt | |
# Go into the certificate and delete everything before -------START ----- and after ------ END ------ | |
# Create your own keystore to use for this certificate -- add as many as you want | |
sudo keytool -trustcacerts -keystore cacerts -storepass cacerts -noprompt -importcert -alias www -file www.crt | |
# Copy that to your android project | |
cp cacerts ~/my/android/project | |
# Add this to your build.gradle or android.gradle (if it's separate) | |
android { | |
signingConfigs { | |
release { | |
storeFile file("cacerts") | |
storePassword "cacerts" | |
keyAlias "www" | |
keyPassword "" | |
} | |
} | |
buildTypes { | |
release { | |
signingConfig signingConfigs.release | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment