我正在尝试使用SSL安全的Spring/服务。
问题: No,我在哪里可以找到一个示例,如何设置以通过客户端证书:(
这里的任何帮助都是非常感谢的。
服务器设置
@Bean(name = "/booking")
RemoteExporter bookingService() {
HessianServiceExporter exporter = new HessianServiceExporter();
exporter.setService(new CabBookingServiceImpl());
exporter.setServiceInterface( CabBookingService.class );
return exporter;
}客户端设置
@Configuration
public class HessianClient {
@Bean
public HessianProxyFactoryBean hessianInvoker() {
HessianProxyFactoryBean invoker = new HessianProxyFactoryBean();
invoker.setServiceUrl("https://super.server/booking");
invoker.setServiceInterface(CabBookingService.class);
return invoker;
}
}发布于 2019-07-25 12:03:00
decided on runtime类型。下面是来自HessianProxyFactory.class的示例代码Class HessianProxyFactory{
protected HessianConnectionFactory createHessianConnectionFactory(){
String className= System.getProperty(HessianConnectionFactory.class.getName());
HessianConnectionFactory factory = null;
try {
if (className != null) {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Class<?> cl = Class.forName(className, false, loader);
factory = (HessianConnectionFactory) cl.newInstance();
return factory;
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return new HessianURLConnectionFactory();
}
}https://stackoverflow.com/questions/57133647
复制相似问题