I read this very useful article about disabling all the https certificates programmatically. I need such approach only in the development. And I'm using Spring. So does anybody have ideas about how can I do the same thing just in spring context files, not in the Java code? I mean this particular part of code:
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
Actually, I can simulate the first line: something like that:
<bean id="sslContext"
class="javax.net.ssl.SSLContext"
factory-method="getInstance">
<constructor-arg type="java.lang.String" value="SSL" />
</bean>
Also, I can create this trustAllCerts bean. But... I confused.. it is possible to call a some method of a bean in spring context initialization? I mean how can I call sc.init and sc.getSocketFactory in spring context file? Is it impossible or not?