Skip to content

add a feature for https #9

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

Open
grimm26 opened this issue Apr 9, 2015 · 5 comments
Open

add a feature for https #9

grimm26 opened this issue Apr 9, 2015 · 5 comments

Comments

@grimm26
Copy link

grimm26 commented Apr 9, 2015

Sometimes I want to check a port for an app that is forcing a redirect (301) to https. Is it possible to use https into the socket?

@Soulou
Copy link
Owner

Soulou commented Apr 9, 2015

Done in 4aed381

Example of usage:

go run server_examples/https.go example.sock certpath.pem keypath.pem &
go build
./curl-unix-socket -https -k unix://example.sock:/

You need to create the cert/key before with OpenSSL for example.

Does it answer your need?

@grimm26
Copy link
Author

grimm26 commented Apr 9, 2015

I tried it on a socket for a puma web server I have running:

curl-unix-socket -k -https -v unix:///var/run/project/puma-2.sock:
Fail to connect to /var/run/project/puma-2.sock : tls: oversized record received with length 20527

@Soulou
Copy link
Owner

Soulou commented Apr 9, 2015

What is the result of

curl-unix-socket -v unix:///var/run/project/puma-2.sock:

??

@grimm26
Copy link
Author

grimm26 commented Apr 10, 2015

$ curl-unix-socket -v unix:///var/run/project/puma-2.sock:
> GET  HTTP/1.1
> Socket: /var/run/project/puma-2.sock
> Content-Length: 0
>
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html
< Location: https:///

Works fine. I get a 301 cuz the app redirects to https, which is why I wanted the https :)

@Soulou
Copy link
Owner

Soulou commented Apr 27, 2015

ok got it, I've to handle http to https redirection

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

No branches or pull requests

2 participants