本文整理汇总了Java中com.lambdaworks.redis.RedisURI.setVerifyPeer方法的典型用法代码示例。如果您正苦于以下问题:Java RedisURI.setVerifyPeer方法的具体用法?Java RedisURI.setVerifyPeer怎么用?Java RedisURI.setVerifyPeer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lambdaworks.redis.RedisURI
的用法示例。
在下文中一共展示了RedisURI.setVerifyPeer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyProperties
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
private void applyProperties(String scheme, RedisURI redisURI) {
if (isNotEmpty(getPassword())) {
redisURI.setPassword(getPassword());
}
if (RedisURI.URI_SCHEME_REDIS_SECURE.equals(scheme) || RedisURI.URI_SCHEME_REDIS_SECURE_ALT.equals(scheme)
|| RedisURI.URI_SCHEME_REDIS_TLS_ALT.equals(scheme)) {
redisURI.setVerifyPeer(verifyPeer);
}
}
示例2: applyUriConnectionSettings
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
/**
* Apply {@link RedisURI} settings such as SSL/Timeout/password.
*
* @param from from {@link RedisURI}.
* @param to from {@link RedisURI}.
*/
static void applyUriConnectionSettings(RedisURI from, RedisURI to) {
if (from.getPassword() != null && from.getPassword().length != 0) {
to.setPassword(new String(from.getPassword()));
}
to.setTimeout(from.getTimeout());
to.setUnit(from.getUnit());
to.setSsl(from.isSsl());
to.setStartTls(from.isStartTls());
to.setVerifyPeer(from.isVerifyPeer());
}
示例3: main
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
public static void main(String[] args) {
// Syntax: rediss://[[email protected]]host[:port]
RedisURI redisURI = RedisURI.create("rediss://[email protected]:7379");
redisURI.setVerifyPeer(false); // depending on your setup, you might want to disable peer verification
RedisClusterClient redisClient = RedisClusterClient.create(redisURI);
StatefulRedisClusterConnection<String, String> connection = redisClient.connect();
System.out.println("Connected to Redis");
connection.close();
redisClient.shutdown();
}
示例4: clientWithDifferentVerifyPeerSettings
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void clientWithDifferentVerifyPeerSettings() throws Exception {
RedisURI redisURI = RedisURI.create("rediss://host1");
redisURI.setVerifyPeer(false);
RedisClusterClient.create(Arrays.asList(redisURI, RedisURI.create("rediss://host1")));
}