Skip to content

Instantly share code, notes, and snippets.

@gp187
Created October 10, 2017 23:15
Show Gist options
  • Save gp187/b99a0e98336a69c28f77e64aa65d49fb to your computer and use it in GitHub Desktop.
Save gp187/b99a0e98336a69c28f77e64aa65d49fb to your computer and use it in GitHub Desktop.
How to make Gradle work with Letsencrypt certificates in Nexus
#!/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