本文整理汇总了Java中org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer类的典型用法代码示例。如果您正苦于以下问题:Java TLSProtocolConfigurer类的具体用法?Java TLSProtocolConfigurer怎么用?Java TLSProtocolConfigurer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TLSProtocolConfigurer类属于org.springframework.security.saml.trust.httpclient包,在下文中一共展示了TLSProtocolConfigurer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configure_defaults
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@Test
public void configure_defaults() throws Exception {
TLSConfigurer configurer = spy(new TLSConfigurer());
TLSProtocolConfigurer tlsProtocolConfigurer = mock(TLSProtocolConfigurer.class);
when(configurer.createDefaultTlsProtocolConfigurer()).thenReturn(tlsProtocolConfigurer);
configurer.init(builder);
configurer.configure(builder);
verify(tlsConfig).getProtocolName();
verify(tlsConfig).getProtocolPort();
verify(tlsConfig).getSslHostnameVerification();
verify(tlsConfig).getTrustedKeys();
verify(builder).setSharedObject(eq(TLSProtocolConfigurer.class), eq(tlsProtocolConfigurer));
verify(tlsProtocolConfigurer).setProtocolName(eq(tlsConfig.getProtocolName()));
verify(tlsProtocolConfigurer).setProtocolPort(eq(tlsConfig.getProtocolPort()));
verify(tlsProtocolConfigurer).setSslHostnameVerification(eq(tlsConfig.getSslHostnameVerification()));
verify(tlsProtocolConfigurer).setTrustedKeys(eq(tlsConfig.getTrustedKeys()));
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:18,代码来源:TLSConfigurerTest.java
示例2: configure_custom
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@Test
public void configure_custom() throws Exception {
TLSConfigurer configurer = spy(new TLSConfigurer());
TLSProtocolConfigurer tlsProtocolConfigurer = mock(TLSProtocolConfigurer.class);
when(configurer.createDefaultTlsProtocolConfigurer()).thenReturn(tlsProtocolConfigurer);
configurer
.protocolName("protocol")
.protocolPort(9999)
.sslHostnameVerification("strict")
.trustedKeys("one", "two");
configurer.init(builder);
configurer.configure(builder);
verify(tlsConfig, never()).getProtocolName();
verify(tlsConfig, never()).getProtocolPort();
verify(tlsConfig, never()).getSslHostnameVerification();
verify(tlsConfig, never()).getTrustedKeys();
verify(builder).setSharedObject(eq(TLSProtocolConfigurer.class), eq(tlsProtocolConfigurer));
verify(tlsProtocolConfigurer).setProtocolName(eq("protocol"));
verify(tlsProtocolConfigurer).setProtocolPort(eq(9999));
verify(tlsProtocolConfigurer).setSslHostnameVerification(eq("strict"));
verify(tlsProtocolConfigurer).setTrustedKeys((Set<String>) argThat(contains("one", "two")));
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:23,代码来源:TLSConfigurerTest.java
示例3: configure
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@Override
public void configure(ServiceProviderBuilder builder) throws Exception {
KeyManager keyManager = builder.getSharedObject(KeyManager.class);
TLSProtocolConfigurer configurer = createDefaultTlsProtocolConfigurer();
configurer.setProtocolName(Optional.ofNullable(protocolName).orElseGet(config::getProtocolName));
configurer.setProtocolPort(Optional.ofNullable(protocolPort).orElseGet(config::getProtocolPort));
configurer.setSslHostnameVerification(Optional.ofNullable(sslHostnameVerification).orElseGet(config::getSslHostnameVerification));
configurer.setTrustedKeys(Optional.ofNullable(trustedKeys).orElseGet(config::getTrustedKeys));
configurer.setKeyManager(keyManager);
configurer.afterPropertiesSet();
builder.setSharedObject(TLSProtocolConfigurer.class, configurer);
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:13,代码来源:TLSConfigurer.java
示例4: createDefaultTlsProtocolConfigurer
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@VisibleForTesting
protected TLSProtocolConfigurer createDefaultTlsProtocolConfigurer() {
return new TLSProtocolConfigurer();
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:5,代码来源:TLSConfigurer.java
示例5: tlsProtocolConfigurer
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@Bean
public TLSProtocolConfigurer tlsProtocolConfigurer() {
return new TLSProtocolConfigurer();
}
开发者ID:takesection,项目名称:spring-boot-saml2,代码行数:5,代码来源:WebSecurityConfig.java
示例6: tlsProtocolConfigurer
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@Bean
public TLSProtocolConfigurer tlsProtocolConfigurer(KeyManager keyManager) {
TLSProtocolConfigurer configurer = new TLSProtocolConfigurer();
configurer.setKeyManager(keyManager);
return configurer;
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml-samples,代码行数:7,代码来源:SAMLConfig.java
示例7: tlsProtocolConfigurer
import org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer; //导入依赖的package包/类
@Bean
public TLSProtocolConfigurer tlsProtocolConfigurer() {
return new TLSProtocolConfigurer();
}
开发者ID:chrludwig,项目名称:websec-saml2sp,代码行数:5,代码来源:SamlSpringSecurityConfig.java
注:本文中的org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论