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

HTTPS Support #106

Closed
mathieucarbou opened this issue Apr 27, 2014 · 4 comments
Closed

HTTPS Support #106

mathieucarbou opened this issue Apr 27, 2014 · 4 comments
Milestone

Comments

@mathieucarbou
Copy link

Hello,
Does RxNetty Http client can connect to https websites ? I do not see any doc or sample relating to https.
Thank you!

@mathieucarbou mathieucarbou changed the title HTTP Support HTTPS Support Apr 27, 2014
@NiteshKant
Copy link
Member

Netty supports SSL via SSLHandler so RxNetty also does support SSL.

You can create a PipelineConfigurator implementation that adds an SSLHandler in the pipeline much as this example in netty demonstrates. In order to understand RxNetty's PipelineConfigurators have a look at the pipeline package

Having said the above, I think we should add an HTTPs example. I will add the same.

@NiteshKant NiteshKant added this to the 0.3.6 milestone May 23, 2014
@NiteshKant NiteshKant self-assigned this May 23, 2014
@tbak tbak assigned tbak and unassigned NiteshKant Jun 16, 2014
@tbak
Copy link
Collaborator

tbak commented Jun 17, 2014

To add SSL/TLS support to RxNetty, the RxServer/RxClient pipeline setup must be made more flexible.

SSL handling is supported by Netty's SslHandler ChannelHandler. It enforces a three step process for full communication setup:

  1. Start with basic pipeline configuration and SSL ChannelInitializer in the pipeline
  2. On channel registration inject SslHandler as a first handler
  3. On SslHandshakeCompletionEvent event activate RxNetty's ConnectionHandler (to ensure nothing is written to the channel prior to handshake completion)

The first two steps can be done easily now. What is less obvious is how to prevent ObservableConnection from firing write events into the channel prior to getting handshake confirmation event.

Having said that here is a working prototype for TCP protocol without waiting for handshake complete event: tbak@4c55b21

Any read or write to the channel will enforce handshake negotiation in a first place. I am not sure if we can rely on it, or strictly follow the rules written in SslHandler documentation.

@tbak
Copy link
Collaborator

tbak commented Jun 17, 2014

First version with proper handling of the handshake event is available here: https://github.com/tbak/RxNetty/commits/features/ssl

tbak pushed a commit to tbak/RxNetty that referenced this issue Jun 19, 2014
@NiteshKant NiteshKant modified the milestones: 0.3.7, 0.3.6 Jun 24, 2014
tbak pushed a commit to tbak/RxNetty that referenced this issue Jun 24, 2014
tbak pushed a commit to tbak/RxNetty that referenced this issue Jun 24, 2014
tbak pushed a commit that referenced this issue Jun 25, 2014
Add SSL support (issue #106).
@tbak
Copy link
Collaborator

tbak commented Jun 25, 2014

SSL support is now implemented. Most of the changes are in this commit: 07c39de.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants