Tool | Version |
---|---|
Gradle | 8.11.1 |
IntelliJ Platform Gradle Plugin | 2.7.0 |
When trying to configure the plugin signing task using environment variables, passing the raw certificate content to certificateChain.set()
fails with Invalid argument, whereas pointing to a file works.
Example that fails:
signing {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
Error:
Invalid argument: -----BEGIN CERTIFICATE-----
MIIF5zCCA8+gAwIBAgIU...
Example that works:
signing {
certificateChainFile = file("/Users/.../chain.crt") // path to file
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
Shouldn’t it be possible to pass the certificate content via an environment variable (multi-line string) without having to write it to a file manually?
Steps to reproduce
Set an environment variable CERTIFICATE_CHAIN with the full multi-line certificate content.
Configure signing using certificateChain.set(System.getenv(“CERTIFICATE_CHAIN”)).
Run ./gradlew verifyPluginSignature.