Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow custom ssl options #61

Merged
merged 1 commit into from
Sep 24, 2018
Merged

allow custom ssl options #61

merged 1 commit into from
Sep 24, 2018

Conversation

steffkes
Copy link
Contributor

@steffkes steffkes commented Sep 10, 2018

this PR contains the simple change which i've mentioned over at #33. for a connection which uses client certificates, that would be for example:

{:ok, _} = WebSockex.start_link(
  WebSockex.Conn.new(
    "wss://host/path",
    ssl_options: [
      cacertfile: "/certificates/ca.pem",
      certfile: "/certificates/cert.pem",
      keyfile: "/certificates/key.pem"
    ]
  ),
  __MODULE__,
  :fake_state
)

@Azolo
Copy link
Owner

Azolo commented Sep 13, 2018

I like this, the only thing I would say is instead of :ssl would :ssl_options make more sense?

@steffkes
Copy link
Contributor Author

Thanks @Azolo. Yes, absolutely makes sense! i've changed names and pushed an update.


test "open_socket with custom ssl options", context do
ssl_options = [cacertfile: Path.join([__DIR__, "..", "support", "priv", "websockexca.cer"])]
conn = WebSockex.Conn.new(context.uri, ssl: ssl_options)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't match what you have in your example. 😣

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah .. not only didn't it match the example .. the entire change was missing. no idea how i missed it, sorry for the noise. i've pushed an update.

for a connection which uses client certificates, that would be for example:

```
{:ok, _} = WebSockex.start_link(
  WebSockex.Conn.new(
    "wss://host/path",
    ssl_options: [
      cacertfile: "/certificates/ca.pem",
      certfile: "/certificates/cert.pem",
      keyfile: "/certificates/key.pem"
    ]
  ),
  __MODULE__,
  :fake_state
)
```
@steffkes
Copy link
Contributor Author

@Azolo anything else or are we good to go with this?

@Azolo Azolo merged commit c8b8fcd into Azolo:master Sep 24, 2018
@steffkes
Copy link
Contributor Author

thanks a lot!

@Azolo
Copy link
Owner

Azolo commented Sep 24, 2018

@steffkes Thanks for the ping, been super busy and totally forget.

@steffkes
Copy link
Contributor Author

no worries, i guess every maintainer knows that situation pretty well. a gentle reminder goes a long way :)

@steffkes steffkes deleted the ssl-options branch January 11, 2019 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants