Skip to content
Menu
Billy Fisher
  • Home
  • Talks
  • About Me
  • Resume
Billy Fisher

Mac OS Import Keystore for Target Endpoint Under Test

Posted on March 1, 2017June 29, 2018 by Billy

So I like the following in obtaining browser client certs so that my test clients (i.e. io.restassured) can trust them:

openssl s_client -connect www.website.com:443 -showcerts

Then I can import the server cert for my integration tests into a new keystore:

cd ~
/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/keytool -import -trustcacerts -keystore cacerts -noprompt -file ~/browser_cert.cer

and then have my tests use the specific keystore (~/cacerts) during testing:

System.setProperty("javax.net.ssl.trustStore", "/Users/bfish3/cacerts");

Or, in Bash:

echo "Q" | openssl s_client -connect www.website.com:443 -showcerts 2>/dev/null | grep "BEGIN CERTIFICATE" -A 30 > import.cer
keytool -import -trustcacerts -keystore imported_cer.jks -noprompt -file import.cer -storepass changeit

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

32 − 25 =

Categories

  • Building the Elasticbeanstalk Source Bundle
  • Cloud Computing
  • Coding
  • Computing
  • Going Serverless on Wordpress for AWS
  • Uncategorized

This Site Hosted On

Amazon Web Services: ElasticBeanstalk, RDS, and EFS. Really enjoying just focusing in on the content and having ElasticBeanstalk, and the package build process, perform all of the LAMP and Wordpress updates, automatically. Using aws blueprint: aws_blueprint_ebs_wordpress_efs_rds

My Github Projects

  • api-gateway-custom-authorizers
  • async-http-client-gradle-scala
  • async-http-client-sbt-scala
  • aws-serverless-express
  • aws_api_gateway_http_proxy_redirect_rewrite
  • aws_blueprint_ebs_wordpress_efs_rds
  • aws_lambda_scala_ec2_reports
  • aws_serverless_application_model_python
  • bike-distributor-refactor
  • CRUDUsers
  • digital-ocean-jenkins-dev-environment
  • java-functional-tests
  • java9-hello-modules
  • kind-argo
  • nbbo
©2023 Billy Fisher | Theme: Wordly by SuperbThemes