Skip to content

Instantly share code, notes, and snippets.

@PetrGlad
Last active July 4, 2020 10:38
Show Gist options
  • Save PetrGlad/ee324b70f009066bb61b52726e4a22f2 to your computer and use it in GitHub Desktop.
Save PetrGlad/ee324b70f009066bb61b52726e4a22f2 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Fix for working in IntelliJ behind corporate firewall in Linux.
# Note that this makes your Idea's TLS communications monitored.
# Note that if you have a JetBrains license owned by your company,
# then better ask your IT support to fix cert problems instead.
# Howto:
# 0. Your company cert is expected to be in /usr/local/share/ca-certificates/extra/MyCompanyCA.crt
# 1. Launch Intellij.
# 2. Copy CA storage path from the "certificate problem" pop up dialog. Close IntelliJ.
# 3. Run this script with that path as an argument.
CASTORE=$1
openssl x509 \
-in /usr/local/share/ca-certificates/extra/MyCompanyCA.crt \
-inform pem \
-out ca.der \
-outform der
keytool -importcert \
-alias aggrekoca \
-keystore "$CASTORE" \
-storepass changeit \
-file ca.der
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment