Oneliner PSCredential to use as an argument to functions that require a PSCredential as argument
(New-Object System.Management.Automation.PSCredential("username"exit, (ConvertTo-SecureString "password" -AsPlainText -Force)))
Oneliner PSCredential to use as an argument to functions that require a PSCredential as argument
(New-Object System.Management.Automation.PSCredential("username"exit, (ConvertTo-SecureString "password" -AsPlainText -Force)))
When creating a custom SSLSocketFactory or modifing the application in any other way is not an option
This example uses a Tomcat server listing for HTTPS connections on port 8443 but should work anywhere.
Retrieve the public key:
$openssl s_client -connect localhost:8443
, then create a file localhost.pem that looks like
BEGIN CERTIFICATE-----
lklkkkllklklklklllkllklkl
lklkkkllklklklklllkllklkl
lklkkkllklk
END CERTIFICATE
Import the key:
#keytool -import -alias localhost-selfsigned -keystore $JAVA_HOME/jre/lib/security/cacerts -file localhost.pem
When promted for password, write changeit
Restart JVM / Application server instance.