Last active
January 4, 2016 06:12
-
-
Save starhoshi/daeddcf097a47e490904 to your computer and use it in GitHub Desktop.
cordova ios9 App Transport Security (project_root/after_prepare/ios9-transport-security.sh)
This file contains hidden or 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
#!/bin/bash | |
PLIST=platforms/ios/*/*-Info.plist | |
cat << EOF | | |
Add :NSAppTransportSecurity dict | |
Add :NSAppTransportSecurity:NSExceptionDomains dict | |
Add :NSAppTransportSecurity:NSExceptionDomains:dev.example.com dict | |
Add :NSAppTransportSecurity:NSExceptionDomains:dev.example.com:NSExceptionAllowsInsecureHTTPLoads bool YES | |
Add :NSAppTransportSecurity:NSExceptionDomains:dev.example.com:NSExceptionRequiresForwardSecrecy bool NO | |
Add :NSAppTransportSecurity:NSExceptionDomains:dev.example.com:NSExceptionMinimumTLSVersion string TLSv1.0 | |
Add :NSAppTransportSecurity:NSExceptionDomains:production.example.com dict | |
Add :NSAppTransportSecurity:NSExceptionDomains:production.example.com:NSExceptionAllowsInsecureHTTPLoads bool YES | |
Add :NSAppTransportSecurity:NSExceptionDomains:production.example.com:NSExceptionRequiresForwardSecrecy bool NO | |
Add :NSAppTransportSecurity:NSExceptionDomains:production.example.com:NSExceptionMinimumTLSVersion string TLSv1.0 | |
EOF | |
while read line | |
do | |
/usr/libexec/PlistBuddy -c "$line" $PLIST | |
done | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment