Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
Created December 14, 2016 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DinisCruz/c297344a097f4febc1fce688d7171318 to your computer and use it in GitHub Desktop.
Save DinisCruz/c297344a097f4febc1fce688d7171318 to your computer and use it in GitHub Desktop.
Script to set the pwd to use curl with an bbc cert (exported in OSX from KeyChain access)
#!/bin/bash
echo
echo "Note: run this using . ./set-cert-pwd.sh to set the variable in the host bash (it is expected that the bbc-cert.p12 is in the current path"
echo "What is the .p12 password: "
read -s pwd
export P12_PWD=$pwd
echo "The password has been set to the P12_PWD variable"
echo
echo "Testing using:"
echo
echo "curl -s --cert bbc-cert.p12:\$P12_PWD \"https://confluence.dev.bbc.co.uk/rest/api/content/?limit=0&start=0\" | python -mjson.tool "
echo
curl -s --cert bbc-cert.p12:$P12_PWD "https://confluence.dev.bbc.co.uk/rest/api/content/?limit=0&start=0" | python -mjson.tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment