conexão SSL para Thin através de vagrant

1

Estou executando um aplicativo Rails que força o SSL e usa a autenticação básica HTTP dentro de uma VM vagante. Se eu tentar fazer uma solicitação de onda para o aplicativo da minha máquina host, obtenho

curl -k --verbose https://[user]:[password]@localhost:3001/
* About to connect() to localhost port 3001 (#0)
*   Trying ::1...
* Connection refused
*   Trying fe80::1...
* Connection refused
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 3001 (#0)
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to localhost:3001 
* Closing connection #0
curl: (35) Unknown SSL protocol error in connection to localhost:3001 

Se eu fizer a mesma solicitação de onda dentro da VM, ela funciona

curl -k --verbose https://[user]:[password]@localhost:3001/
* About to connect() to localhost port 3001 (#0)
*  Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3001 (#0)
* successfully set certificate verify locations:
*  CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
* subject: C=AU; ST=Some-State; O=Internet Widgits Pty Ltd
* start date: 2013-10-15 19:38:54 GMT
* expire date: 2023-10-13 19:38:54 GMT
* issuer: C=AU; ST=Some-State; O=Internet Widgits Pty Ltd
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> GET / HTTP/1.1
> Authorization: Basic [stuff]
> User-Agent: curl/7.29.0
> Host: localhost:3001
> Accept: */*
> 
< HTTP/1.1 200 OK
< Strict-Transport-Security: max-age=31536000
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-UA-Compatible: chrome=1
< Content-Type: application/json; charset=utf-8
< ETag: "80961ae530b068989bbd4463b2fb6308"
< Cache-Control: max-age=0, private, must-revalidate
< Set-Cookie: request_method=GET; path=/; secure
< X-Request-Id: 9d0426ec-eca2-469a-9e36-14c79d69596a
< X-Runtime: 0.894703
< Connection: close
< Server: thin 1.5.1 codename Straight Razor
< 
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):
[page]

Estou começando a ficar magro na VM usando um certificado auto-assinado que criei e adicionei ao meu mac keychain

bundle exec thin start --ssl --ssl-key-file /etc/ssl/server.key --ssl-cert-file /etc/ssl/server.crt -p 3001

Vejo que o problema é "erro do protocolo Unkown SSL", mas nada que eu tenha encontrado on-line foi útil. A partir da saída, você pode ver que ambos estão usando o SSLv3. A chave não expirou. Eu não tenho nada, ajuda.

    
por The Q CS or GS 16.10.2013 / 21:15

1 resposta

0

O encaminhamento de porta foi configurado incorretamente no Vagrantfile. Eu estava se conectando ao postgresql em vez de Thin, portanto, uma conexão, mas erro SSL. Copie o erro de colar.

    
por 17.10.2013 / 15:52