Java SSLContext and the SSLSocketFactory self signed certificate

Problem Often we want to connect to create a secure SSL connection to an HTTPs endpoint which is secured by a self signed Certificate. If we do so just with a simple call we usually face an nice exception like :

Solution Often I see that either somebody uses an trust all or just…