List of usage examples for javax.net.ssl SSLEngine getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:mitm.BouncyCastleSslEngineSource.java
private boolean tryHostNameVerificationJava6(SSLEngine sslEngine) { // Very ugly internal access, but should work with Java 6 from Oracle, // but won't work with my Java 6 from Apple and what's about Android? ///* ww w . java 2s. co m*/ if ("sun.security.ssl.SSLEngineImpl".equals(sslEngine.getClass().getName())) { try { Method method = sslEngine.getClass().getMethod("tryHostNameVerification", String.class); method.invoke(sslEngine, "HTTPS"); return true; } catch (IllegalAccessException e) { LOG.debug("sun.security.ssl.SSLEngineImpl#tryHostNameVerification", e); } catch (InvocationTargetException e) { LOG.debug("sun.security.ssl.SSLEngineImpl#tryHostNameVerification", e); } catch (NoSuchMethodException e) { LOG.debug("sun.security.ssl.SSLEngineImpl#tryHostNameVerification", e); } catch (SecurityException e) { LOG.debug("sun.security.ssl.SSLEngineImpl#tryHostNameVerification", e); } } return false; }