mirror of
https://github.com/ctripcorp/zeus.git
synced 2024-09-20 15:46:01 +08:00
add ssl protocol config
This commit is contained in:
parent
d580f5d27f
commit
f7c3f12fb6
|
@ -52,6 +52,7 @@ public class ServerConf {
|
||||||
confWriter.writeCommand("ssl", "on");
|
confWriter.writeCommand("ssl", "on");
|
||||||
confWriter.writeCommand("ssl_certificate", SSL_PATH + vsId + "/ssl.crt");
|
confWriter.writeCommand("ssl_certificate", SSL_PATH + vsId + "/ssl.crt");
|
||||||
confWriter.writeCommand("ssl_certificate_key", SSL_PATH + vsId + "/ssl.key");
|
confWriter.writeCommand("ssl_certificate_key", SSL_PATH + vsId + "/ssl.key");
|
||||||
|
confWriter.writeCommand("ssl_protocols",getProtocols(slbId,vsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configHandler.getEnable("server.vs.health.check", slbId, vsId, null, false)) {
|
if (configHandler.getEnable("server.vs.health.check", slbId, vsId, null, false)) {
|
||||||
|
@ -79,6 +80,17 @@ public class ServerConf {
|
||||||
return confWriter.getValue();
|
return confWriter.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getProtocols(Long slbId, Long vsId) throws Exception {
|
||||||
|
String result = "TLSv1 TLSv1.1 TLSv1.2";
|
||||||
|
if (configHandler.getEnable("ssl.protocol.sslv2",slbId,vsId,null,false)){
|
||||||
|
result += " SSLv2";
|
||||||
|
}
|
||||||
|
if (configHandler.getEnable("ssl.protocol.sslv3",slbId,vsId,null,false)){
|
||||||
|
result += " SSLv3";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getServerNames(VirtualServer vs) throws Exception {
|
private String getServerNames(VirtualServer vs) throws Exception {
|
||||||
StringBuilder b = new StringBuilder(128);
|
StringBuilder b = new StringBuilder(128);
|
||||||
|
|
Loading…
Reference in a new issue