lumeohq / onvif-rs

A native Rust ONVIF client library.
MIT License
114 stars 61 forks source link

Certificate validation #40

Open DmitrySamoylov opened 4 years ago

DmitrySamoylov commented 4 years ago

Some cameras use self-signed cert which cannot be validated by default. Need to either ignore validation or allow passing the cert for communications. Reqwest supports both ways https://docs.rs/reqwest/0.10.4/reqwest/struct.Certificate.html https://docs.rs/reqwest/0.10.4/reqwest/struct.ClientBuilder.html#method.danger_accept_invalid_certs

chrisabruce commented 4 years ago

Can we make this a runtime configurable option?

DmitrySamoylov commented 4 years ago

Along with credentials we can pass enum like

enum Cert {
  Cert(String),  // Provided by user (Safe)
  AcceptInvalid, // Accept self-signed (Dangerous)
  None           // Accept CA signed or http-only requests
}