当前位置:网站首页>Sslhandshakeexception: no subject alternative names present - sslhandshakeexception: no subject alternative names present
Sslhandshakeexception: no subject alternative names present - sslhandshakeexception: no subject alternative names present
2022-06-24 21:36:00 【Bustling city 】
problem :
I am invoking HTTPS SOAP web service through java code. I passed java Code calls HTTPS SOAP Web service .I have already imported self-signed certificate in jre cacerts keystore. I am already in jre cacerts Self signed certificate imported in keystore .Now I am getting : Now I get :
com.sun.xml.internal.ws.com.client.ClientTransportException: HTTP transport error: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names presentThe hostname of the service URL is not matching that of the CN provided in cert. service URL The host name of the is the same as cert Provided in CN The hostname of does not match .I read about a workaround of defining a custom Hostname verifier here . I ad locum Read about how to define a custom hostname validator .But i cant able to make where I should implement the workaround in my code. But I can't implement the solution in my code .
public SOAPMessage invokeWS(WSBean bean) throws Exception { SOAPMessage response=null; try{ /** Create a service and add at least one port to it. **/ String targetNameSpace = bean.getTargetNameSpace(); String endpointUrl = bean.getEndpointUrl(); QName serviceName = new QName(targetNameSpace, bean.getServiceName()); QName portName = new QName(targetNameSpace, bean.getPortName()); String SOAPAction = bean.getSOAPAction(); HashMap<String, String> map = bean.getParameters(); Service service = Service.create(serviceName); service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, endpointUrl); /** Create a Dispatch instance from a service. **/ Dispatch dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE); // The soapActionUri is set here. otherwise we get a error on .net based // services. dispatch.getRequestContext().put(Dispatch.SOAPACTION_USE_PROPERTY, new Boolean(true)); dispatch.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, SOAPAction); /** Create SOAPMessage request. **/ // compose a request message MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage message = messageFactory.createMessage(); // Create objects for the message parts SOAPPart soapPart = message.getSOAPPart(); SOAPEnvelope envelope = soapPart.getEnvelope(); SOAPBody body = envelope.getBody(); SOAPElement bodyElement = body.addChildElement(bean.getInputMethod(), bean.getPrefix(), bean.getTargetNameSpace()); ...more code to form soap body goes here // Print request message.writeTo(System.out); // Save the message message.saveChanges(); response = (SOAPMessage)dispatch.invoke(message); } catch (Exception e) { log.error("Error in invokeSiebelWS :"+e); } return response;}Please ignore WSBean parameter as the namespaces and other wsdl attributes are coming from this bean. Please ignore WSBean Parameters , Because of namespaces and other wsdl Attributes come from this bean.And if this exception can solved with some different workarounds, pls do suggest. If this exception can be solved by some different solutions , Please advise .
Solution :
Reference resources : https://stackoom.com/en/question/h2bF边栏推荐
- Graduation summary of phase 6 of the construction practice camp
- Basic database syntax learning
- Self signed certificate generation
- (待补充)GAMES101作业7提高-实现微表面模型你需要了解的知识
- Dynamic routing protocol rip, OSPF
- Pattern recognition - 0 introduction
- Pattern recognition - 9 Decision tree
- BPF_ PROG_ TYPE_ SOCKET_ Filter function implementation
- Go coding specification
- [Web Security Basics] some details
猜你喜欢

Blender's simple skills - array, rotation, array and curve

Football information query system based on C language course report + project source code + demo ppt+ project screenshot

Oauth2.0 introduction

VirtualBox虚拟机安装Win10企业版

Tdengine can read and write through dataX

(to be optimized and modified) vivado DDR4 SDRAM (MIG) (2.2) IP core learning record

Volcano成Spark默认batch调度器

Advanced secret of xtransfer technology newcomers: the treasure you can't miss mentor

Multi view function in blender

Dynamic routing protocol rip, OSPF
随机推荐
[cloud native learning notes] learn about kubernetes' pod
Address mapping of virtual memory paging mechanism
About transform InverseTransformPoint, transform. InverseTransofrmDirection
Dijkstra seeking secondary short circuit (easy to understand)
Remember the frequently forgotten problem of continuously reading pictures -%04d
Golang reflection operation collation
TCP Jprobe utilization problem location
Functional analysis of ebpf sockops
Analysis of BBR congestion control state machine
memcached完全剖析–1. memcached的基础
[cloud native learning notes] deploy applications through yaml files
Logical backup: mysqldump vs physical backup: xtrabackup
Memcached comprehensive analysis – 2 Understand memcached memory storage
Call process of package receiving function
Simple analysis of WordPress architecture
SYSCALL_ Define5 setsockopt code flow
Web automation: summary of special scenario processing methods
Poj1061 frog dating (extended Euclid)
Php-pdo parameter binding problem
(to be optimized and modified) vivado DDR4 SDRAM (MIG) (2.2) IP core learning record
