This file contains 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
#!/usr/bin/env groovy | |
import jenkins.model.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.impl.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey | |
import org.jenkinsci.plugins.plaincredentials.StringCredentials | |
import org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl |
This file contains 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
#!/usr/bin/env bash | |
## from a running webserver | |
$ export DOMAIN="example.com" | |
$ openssl s_client -servername ${DOMAIN} -connect ${DOMAIN}:443 < /dev/null | sed -n "/-----BEGIN/,/-----END/p" | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 | pbcopy | |
## from certificate file | |
$ cat example.com.crt | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 | pbcopy |
This file contains 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
#!/usr/bin/env bash | |
## from a running webserver | |
$ export DOMAIN="example.com" | |
$ openssl s_client -servername ${DOMAIN} -connect ${DOMAIN}:443 < /dev/null | sed -n "/-----BEGIN/,/-----END/p" | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | xxd -i | pbcopy | |
## from certificate file | |
$ cat example.com.crt | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | xxd -i | pbcopy |
NewerOlder