{"action":"created","issue":{"url":"https://api.github.com/repos/sfackler/r2d2-postgres/issues/7","repository_url":"https://api.github.com/repos/sfackler/r2d2-postgres","labels_url":"https://api.github.com/repos/sfackler/r2d2-postgres/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/sfackler/r2d2-postgres/issues/7/comments","events_url":"https://api.github.com/repos/sfackler/r2d2-postgres/issues/7/events","html_url":"https://github.com/sfackler/r2d2-postgres/issues/7","id":172847785,"number":7,"title":"How to Use With SslMode::Require?","user":{"login":"SecurityInsanity","id":7262714,"avatar_url":"https://avatars.githubusercontent.com/u/7262714?v=3","gravatar_id":"","url":"https://api.github.com/users/SecurityInsanity","html_url":"https://github.com/SecurityInsanity","followers_url":"https://api.github.com/users/SecurityInsanity/followers","following_url":"https://api.github.com/users/SecurityInsanity/following{/other_user}","gists_url":"https://api.github.com/users/SecurityInsanity/gists{/gist_id}","starred_url":"https://api.github.com/users/SecurityInsanity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SecurityInsanity/subscriptions","organizations_url":"https://api.github.com/users/SecurityInsanity/orgs","repos_url":"https://api.github.com/users/SecurityInsanity/repos","events_url":"https://api.github.com/users/SecurityInsanity/events{/privacy}","received_events_url":"https://api.github.com/users/SecurityInsanity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-24T01:57:46Z","updated_at":"2016-08-24T12:40:49Z","closed_at":null,"body":"I'm just curious what's the recommended way to use r2d2-postgres with SslMode::Require, or Preferred? I've been racking my head around this for awhile, and I assume it's something dumb that I'm just not thinking of.\r\n\r\nI can successfully get a connection over TLS with the normal postgres crate w/ OpenSSL Contexts, but I'm not sure how to get it to work within this crate. Any insight would be very helpful. If you need to see code I've tried I'd be happy to drop it in."},"comment":{"url":"https://api.github.com/repos/sfackler/r2d2-postgres/issues/comments/242048281","html_url":"https://github.com/sfackler/r2d2-postgres/issues/7#issuecomment-242048281","issue_url":"https://api.github.com/repos/sfackler/r2d2-postgres/issues/7","id":242048281,"user":{"login":"SecurityInsanity","id":7262714,"avatar_url":"https://avatars.githubusercontent.com/u/7262714?v=3","gravatar_id":"","url":"https://api.github.com/users/SecurityInsanity","html_url":"https://github.com/SecurityInsanity","followers_url":"https://api.github.com/users/SecurityInsanity/followers","following_url":"https://api.github.com/users/SecurityInsanity/following{/other_user}","gists_url":"https://api.github.com/users/SecurityInsanity/gists{/gist_id}","starred_url":"https://api.github.com/users/SecurityInsanity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SecurityInsanity/subscriptions","organizations_url":"https://api.github.com/users/SecurityInsanity/orgs","repos_url":"https://api.github.com/users/SecurityInsanity/repos","events_url":"https://api.github.com/users/SecurityInsanity/events{/privacy}","received_events_url":"https://api.github.com/users/SecurityInsanity/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T12:40:49Z","updated_at":"2016-08-24T12:40:49Z","body":"Hmmm that's similar to what I tried, but am still getting an error on creating the manager:\r\n```\r\nlet mut context = SslContext::new(SslMethod::Tlsv1);\r\n// configured ctx...\r\nlet manager = PostgresConnectionManager::new(\"postgres://localhost/foobar\", SslMode::Require(Box::new(context))).unwrap();\r\n```\r\n\r\nHowever this results in:\r\n```\r\nsrc/main.rs:32:98: 32:115 error: the trait bound `std::result::Result<openssl::ssl::SslContext, openssl::ssl::error::SslError>: postgres::io::NegotiateSsl` is not satisfied [E0277]\r\nsrc/main.rs:32     let manager = PostgresConnectionManager::new(\"postgres://localhost/foobar\", SslMode::Require(Box::new(context))).unwrap();\r\n                                                                                                                ^~~~~~~~~~~~~~~~~\r\nsrc/main.rs:32:98: 32:115 help: run `rustc --explain E0277` to see a detailed explanation\r\nsrc/main.rs:32:98: 32:115 note: required for the cast to the object type `postgres::io::NegotiateSsl + Send + Sync + 'static`\r\nerror: aborting due to previous error\r\n```"}}
{"actor":{"display_login":"SecurityInsanity"}}