cancel
Showing results for 
Search instead for 
Did you mean: 

TLS1.2 issue with java application

hi,

 

Our site has stopped working from yesterday (02/28/18) and is giving the following error

 

root cause

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

 

Well i have make sure that the machine has TLS1.2 . But still the java application is throwing exception and we are not able to charge the credit cards.

 

We are using the following code for connection to Authorize.net in java file

 

post_url = new URL(
"https://secure2.authorize.net/gateway/transact.dll");
String login = this.getAccountingDefaultService().getPropertyValue(
"authorizeLoginId", "");
String txKey = this.getAccountingDefaultService().getPropertyValue(
"authorizeTransKey", "");
post_values.put("x_login", login);
post_values.put("x_tran_key", txKey);
}
post_values.put("x_version", "3.1");
post_values.put("x_delim_data", "TRUE");
post_values.put("x_delim_char", "|");
post_values.put("x_relay_response", "FALSE");
post_values.put("x_type", "AUTH_CAPTURE");
post_values.put("x_method", "CC");
post_values.put("x_description", "Payment");

 

So any help , how to solve this issue will be appreciated.

 

Nadeem

 

 

nadeemj
Member
5 REPLIES 5

For Java 7: download jar from below link and add to {JAVA_HOME}/jre/lib/security

http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

For Java 8: download jar from below link and add to {JAVA_HOME}/jre/lib/security

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

So I tried this for JAVA7 but again same error.

 

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
	sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
	sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1943)
	sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1059)
	sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1294)
	sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1321)
	sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1305)
	sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:515)
	sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1090)
	sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
	com.netmx.netmemexweb.service.transactions.impl.AuthorizeCreditCardServiceImpl.processTransaction(AuthorizeCreditCardServiceImpl.java:120)
	com.netmx.netmemexweb.web.MeetingRegistrationFormAction.processCreditCard(MeetingRegistrationFormAction.java:1537)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:601)
	org.springframework.webflow.action.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:98)
	org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:123)
	org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
	org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)
	org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
	org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:77)
	org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
	org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)
	org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
	org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101)
	org.springframework.webflow.engine.State.enter(State.java:194)
	org.springframework.webflow.engine.Transition.execute(Transition.java:227)
	org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:391)
	org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
	org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
	org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
	org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:386)
	org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
	org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:230)
	org.springframework.webflow.engine.ViewState.resume(ViewState.java:196)
	org.springframework.webflow.engine.Flow.resume(Flow.java:545)
	org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
	org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
	org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
	org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:174)
	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
	com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

 What would you suggest next?

We are having the same issue with Java 7; we use Tomcat as the application server. We have done the following:

 

a) Applied the jar files from the 

http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

 

b) Set the java options

-Dhttps.protocols=TLSv1.2

 

which worked for other services that are now on TLSv1.2 only

 

c) Also did

SSLContext sslContext = SSLContext.getInstance("TLSv1.2");

            sslContext.init(null, null, null);

            SSLContext.setDefault(sslContext);

 

System.setProperty("https.protocols", "TLSv1.2");

 

But still not able to connect. Same error with the Handshake.

We changed to JDK8 and that seems to have done the trick!!!

Yes, it works with JDK 8; but that requires some more involved due diligence.

 

Any one else has any ideas?