Discussion:
Aleph and https
Patrick Martin
2015-08-11 15:19:29 UTC
Permalink
I am making a demo of two web services, call them Ping and Pong, that talk
to each other over http connection. The Ping service is an aleph server.
The Pong service is right now an aleph client that sends PUT messages to
Ping. When the Ping service receives the message it prints confirmation and
then increments a counter. These little apps work fine but I want to now do
it over https. I have an nginx reverse proxy in front of Ping that upgrades
http to https and then proxies it to the Ping server. When I make a call to
PUT on this server I get a 301 "Moved permanently" response. I then tried
by doing an http PUT but using the https address, but the server throws a
Java SSLHandshakeException.

How do I make aleph http put commands behave with https? I saw in the code
there appears to be an option for "insecure?" but I have not found any
examples. Do I need to put an https proxy in from of Pong to handle all ssl
stuff?

Any guidance would be helpful!

Regards,
Patrick
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zach Tellman
2015-08-11 16:18:36 UTC
Permalink
It's possible you haven't set up the certificate properly, in which case
you need to create a connection pool like so:

(def pool (http/connection-pool {:insecure? true}))

And then add the pool as `{:pool pool}` to your request options. If you
want to create an Aleph server that talks over HTTPS, you'll need to
specify an `:ssl-context`, as described in
http://aleph.io/codox/aleph/aleph.http.html#var-start-server.
Post by Patrick Martin
I am making a demo of two web services, call them Ping and Pong, that talk
to each other over http connection. The Ping service is an aleph server.
The Pong service is right now an aleph client that sends PUT messages to
Ping. When the Ping service receives the message it prints confirmation and
then increments a counter. These little apps work fine but I want to now do
it over https. I have an nginx reverse proxy in front of Ping that upgrades
http to https and then proxies it to the Ping server. When I make a call to
PUT on this server I get a 301 "Moved permanently" response. I then tried
by doing an http PUT but using the https address, but the server throws a
Java SSLHandshakeException.
How do I make aleph http put commands behave with https? I saw in the code
there appears to be an option for "insecure?" but I have not found any
examples. Do I need to put an https proxy in from of Pong to handle all ssl
stuff?
Any guidance would be helpful!
Regards,
Patrick
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Patrick Martin
2015-08-11 16:39:01 UTC
Permalink
Thanks for the guidance. From my research, many people suggest putting an
apache or nginx reverse proxy in front of RESTful services for easier
development. I did not realize we could establish an aleph server that uses
https. I know my nginx server has its certs ok (they are just self signed
for testing) since I have another test app doing GETs through an https
nginx proxy.

Do I use the {:insecure? true} option for the request because of the
reverse proxy?
Post by Zach Tellman
It's possible you haven't set up the certificate properly, in which case
(def pool (http/connection-pool {:insecure? true}))
And then add the pool as `{:pool pool}` to your request options. If you
want to create an Aleph server that talks over HTTPS, you'll need to
specify an `:ssl-context`, as described in
http://aleph.io/codox/aleph/aleph.http.html#var-start-server.
Post by Patrick Martin
I am making a demo of two web services, call them Ping and Pong, that
talk to each other over http connection. The Ping service is an aleph
server. The Pong service is right now an aleph client that sends PUT
messages to Ping. When the Ping service receives the message it prints
confirmation and then increments a counter. These little apps work fine but
I want to now do it over https. I have an nginx reverse proxy in front of
Ping that upgrades http to https and then proxies it to the Ping server.
When I make a call to PUT on this server I get a 301 "Moved permanently"
response. I then tried by doing an http PUT but using the https address,
but the server throws a Java SSLHandshakeException.
How do I make aleph http put commands behave with https? I saw in the
code there appears to be an option for "insecure?" but I have not found any
examples. Do I need to put an https proxy in from of Pong to handle all ssl
stuff?
Any guidance would be helpful!
Regards,
Patrick
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zach Tellman
2015-08-11 16:59:23 UTC
Permalink
A self-signed cert is, by definition, not secure. Setting `:insecure?` to
true tells the client to ignore that fact.
Post by Patrick Martin
Thanks for the guidance. From my research, many people suggest putting an
apache or nginx reverse proxy in front of RESTful services for easier
development. I did not realize we could establish an aleph server that uses
https. I know my nginx server has its certs ok (they are just self signed
for testing) since I have another test app doing GETs through an https
nginx proxy.
Do I use the {:insecure? true} option for the request because of the
reverse proxy?
Post by Zach Tellman
It's possible you haven't set up the certificate properly, in which case
(def pool (http/connection-pool {:insecure? true}))
And then add the pool as `{:pool pool}` to your request options. If you
want to create an Aleph server that talks over HTTPS, you'll need to
specify an `:ssl-context`, as described in
http://aleph.io/codox/aleph/aleph.http.html#var-start-server.
I am making a demo of two web services, call them Ping and Pong, that talk
Post by Zach Tellman
Post by Patrick Martin
to each other over http connection. The Ping service is an aleph server.
The Pong service is right now an aleph client that sends PUT messages to
Ping. When the Ping service receives the message it prints confirmation and
then increments a counter. These little apps work fine but I want to now do
it over https. I have an nginx reverse proxy in front of Ping that upgrades
http to https and then proxies it to the Ping server. When I make a call to
PUT on this server I get a 301 "Moved permanently" response. I then tried
by doing an http PUT but using the https address, but the server throws a
Java SSLHandshakeException.
How do I make aleph http put commands behave with https? I saw in the
code there appears to be an option for "insecure?" but I have not found any
examples. Do I need to put an https proxy in from of Pong to handle all ssl
stuff?
Any guidance would be helpful!
Regards,
Patrick
--
You received this message because you are subscribed to the Google
Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
Post by Patrick Martin
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...