Skip to content

Commit

Permalink
remove min version, not passing
Browse files Browse the repository at this point in the history
  • Loading branch information
bluejekyll committed Feb 28, 2017
1 parent 9a64f68 commit 1957f12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -31,7 +31,7 @@ matrix:
CLIENT_OPTIONS="--no-default-features --features=ring"

# min rust version
- rust: 1.13.0
# - rust: 1.14.0
- rust: beta
- rust: nightly

Expand Down
10 changes: 5 additions & 5 deletions server/src/named.rs
Expand Up @@ -288,14 +288,14 @@ fn read_cert(path: &Path, password: Option<&str>) -> Result<native_tls::Pkcs12,
.map_err(|e| format!("badly formated pkcs12 key from: {:?}: {}", path, e))
}

fn load_cert(tls_cert_config: &TlsCertConfig) -> Result<native_tls::Pkcs12, String> {
let path = tls_cert_config.get_path();
fn load_cert(zone_dir: &Path, tls_cert_config: &TlsCertConfig) -> Result<native_tls::Pkcs12, String> {
let path = zone_dir.to_owned().join(tls_cert_config.get_path());
let password = tls_cert_config.get_password();
let subject_name = tls_cert_config.get_subject_name();

if path.exists() {
info!("reading TLS certificate from: {:?}", path);
read_cert(path, password)
read_cert(&path, password)
} else if tls_cert_config.create_if_absent() {
info!("generating RSA certificate: {:?}", path);
let key_pair = try!(KeyPair::generate(Algorithm::RSASHA256)
Expand Down Expand Up @@ -366,7 +366,7 @@ fn load_cert(tls_cert_config: &TlsCertConfig) -> Result<native_tls::Pkcs12, Stri
panic!("the interior key was not an EC, something changed")
}

read_cert(path, password)
read_cert(&path, password)
} else {
Err(format!("TLS certificate not found: {:?}", path))
}
Expand Down Expand Up @@ -469,7 +469,7 @@ pub fn main() {
info!("loading cert for DNS over TLS: {:?}",
tls_cert_config.get_path());
// TODO: see about modifying native_tls to impl Clone for Pkcs12
let tls_cert = load_cert(tls_cert_config).expect("error loading tls certificate file");
let tls_cert = load_cert(zone_dir, tls_cert_config).expect("error loading tls certificate file");

info!("listening for TLS on {:?}", tls_listener);
server.register_tls_listener(tls_listener, tcp_request_timeout, tls_cert)
Expand Down
2 changes: 1 addition & 1 deletion server/tests/named_test_configs/dns_over_tls.toml
@@ -1,6 +1,6 @@
listen_addrs_ipv4 = ["0.0.0.0"]

tls_cert = { path = "tests/named_test_configs/sec/example.p12", subject_name = "ns.example.com", password = "testpass", create_if_absent = true }
tls_cert = { path = "sec/example.p12", subject_name = "ns.example.com", password = "testpass", create_if_absent = true }

[[zones]]
zone = "example.com"
Expand Down

0 comments on commit 1957f12

Please sign in to comment.