{"action":"created","issue":{"url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/726","repository_url":"https://api.github.com/repos/SergioBenitez/Rocket","labels_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/726/labels{/name}","comments_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/726/comments","events_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/726/events","html_url":"https://github.com/SergioBenitez/Rocket/pull/726","id":347708944,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MjQ1MjIx","number":726,"title":"Allows read for certificates and their keys","user":{"login":"mettke","id":15814071,"node_id":"MDQ6VXNlcjE1ODE0MDcx","avatar_url":"https://avatars0.githubusercontent.com/u/15814071?v=4","gravatar_id":"","url":"https://api.github.com/users/mettke","html_url":"https://github.com/mettke","followers_url":"https://api.github.com/users/mettke/followers","following_url":"https://api.github.com/users/mettke/following{/other_user}","gists_url":"https://api.github.com/users/mettke/gists{/gist_id}","starred_url":"https://api.github.com/users/mettke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mettke/subscriptions","organizations_url":"https://api.github.com/users/mettke/orgs","repos_url":"https://api.github.com/users/mettke/repos","events_url":"https://api.github.com/users/mettke/events{/privacy}","received_events_url":"https://api.github.com/users/mettke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-05T15:47:29Z","updated_at":"2018-08-06T07:35:47Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/726","html_url":"https://github.com/SergioBenitez/Rocket/pull/726","diff_url":"https://github.com/SergioBenitez/Rocket/pull/726.diff","patch_url":"https://github.com/SergioBenitez/Rocket/pull/726.patch"},"body":"This PR addresses #704 and requires https://github.com/SergioBenitez/hyper-sync-rustls/pull/5\r\n\r\nWith the PR it is possible to use custom Files, Arrays, String and pretty much everything else that implements `Read` or can be used in conjunction with `Cursor` for SSL certificates.\r\n\r\n### Example for custom file\r\n\r\n```rust\r\nlet mut config = Config::active().unwrap();\r\nlet certfile = fs::File::open(\"certs/server.crt\").unwrap();\r\nlet keyfile = fs::File::open(\"certs/server.key\").unwrap();\r\nconfig.set_tls_from_read(certfile, keyfile);\r\n```\r\n\r\n### Example for byte vector\r\n\r\n```rust\r\nlet mut config = Config::active().unwrap();\r\nlet certfile_bytes = Cursor::new(include_bytes!(\"certs/server.crt\").to_vec());\r\nlet keyfile_bytes = Cursor::new(include_bytes!(\"certs/server.key\").to_vec());\r\nconfig.set_tls_from_read(certfile, keyfile);\r\n```\r\n\r\n### Example for string\r\n\r\n```rust\r\nlet mut config = Config::active().unwrap();\r\nlet certfile = fs::File::open(\"certs/server.crt\").unwrap();\r\nlet keyfile = fs::File::open(\"certs/server.key\").unwrap();\r\nlet mut certfile_str = String::new();\r\nlet mut keyfile_str = String::new();\r\ncertfile.read_to_string(&mut certfile_str);\r\nkeyfile.read_to_string(&mut keyfile_str);\r\nconfig.set_tls_from_read(Cursor::new(certfile_str), Cursor::new(keyfile_str));\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/comments/410615677","html_url":"https://github.com/SergioBenitez/Rocket/pull/726#issuecomment-410615677","issue_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/726","id":410615677,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDYxNTY3Nw==","user":{"login":"mettke","id":15814071,"node_id":"MDQ6VXNlcjE1ODE0MDcx","avatar_url":"https://avatars0.githubusercontent.com/u/15814071?v=4","gravatar_id":"","url":"https://api.github.com/users/mettke","html_url":"https://github.com/mettke","followers_url":"https://api.github.com/users/mettke/followers","following_url":"https://api.github.com/users/mettke/following{/other_user}","gists_url":"https://api.github.com/users/mettke/gists{/gist_id}","starred_url":"https://api.github.com/users/mettke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mettke/subscriptions","organizations_url":"https://api.github.com/users/mettke/orgs","repos_url":"https://api.github.com/users/mettke/repos","events_url":"https://api.github.com/users/mettke/events{/privacy}","received_events_url":"https://api.github.com/users/mettke/received_events","type":"User","site_admin":false},"created_at":"2018-08-06T07:35:47Z","updated_at":"2018-08-06T07:35:47Z","author_association":"CONTRIBUTOR","body":"Build failure due to the missing PR in hyper-sync-rustls"}}
{"actor":{"display_login":"mettke"}}