差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
java:ldap:spring:simpleauthentication [2016/04/02 19:14]
tony [With TLS(StartTLS)]
java:ldap:spring:simpleauthentication [2023/06/25 09:48] (目前版本)
行 57: 行 57:
   
 DefaultTlsDirContextAuthenticationStrategy strategy = new DefaultTlsDirContextAuthenticationStrategy();​ DefaultTlsDirContextAuthenticationStrategy strategy = new DefaultTlsDirContextAuthenticationStrategy();​
-strategy.setHostnameVerifier(new HostnameVerifier() { +strategy.setHostnameVerifier((hostnamesslsession-> 
- @Override + return true;
- public boolean verify(String arg0SSLSession arg1) { +
- return true; +
- }+
 }); });
 +
 contextSource.setAuthenticationStrategy(strategy);​ contextSource.setAuthenticationStrategy(strategy);​
 contextSource.afterPropertiesSet();​ contextSource.afterPropertiesSet();​
行 76: 行 74:
 } }
 </​code>​ </​code>​
 +為了確認真的是TLS,透別使用wireshark觀察一下:​ [[pc:​goodsoftware:​wireshark|link]]。
 ===== Reference ===== ===== Reference =====
   * [[http://​www.jayway.com/​2009/​02/​02/​simple-authentication-using-spring-ldap/​|simple-authentication-using-spring-ldap]]   * [[http://​www.jayway.com/​2009/​02/​02/​simple-authentication-using-spring-ldap/​|simple-authentication-using-spring-ldap]]
-  * +  * [[http://​stackoverflow.com/​questions/​16570222/​how-to-authenticate-against-active-directory-via-ldap-over-tls|how-to-authenticate-against-active-directory-via-ldap-over-tls]]
  
 =====  ===== =====  =====