{"action":"created","issue":{"url":"https://api.github.com/repos/puma/puma/issues/829","repository_url":"https://api.github.com/repos/puma/puma","labels_url":"https://api.github.com/repos/puma/puma/issues/829/labels{/name}","comments_url":"https://api.github.com/repos/puma/puma/issues/829/comments","events_url":"https://api.github.com/repos/puma/puma/issues/829/events","html_url":"https://github.com/puma/puma/issues/829","id":117969693,"number":829,"title":"Failed SSL connections on MS Windows","user":{"login":"Zapotek","id":375743,"avatar_url":"https://avatars1.githubusercontent.com/u/375743?v=4","gravatar_id":"","url":"https://api.github.com/users/Zapotek","html_url":"https://github.com/Zapotek","followers_url":"https://api.github.com/users/Zapotek/followers","following_url":"https://api.github.com/users/Zapotek/following{/other_user}","gists_url":"https://api.github.com/users/Zapotek/gists{/gist_id}","starred_url":"https://api.github.com/users/Zapotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zapotek/subscriptions","organizations_url":"https://api.github.com/users/Zapotek/orgs","repos_url":"https://api.github.com/users/Zapotek/repos","events_url":"https://api.github.com/users/Zapotek/events{/privacy}","received_events_url":"https://api.github.com/users/Zapotek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-11-20T05:49:56Z","updated_at":"2017-08-12T09:59:36Z","closed_at":"2016-07-24T23:02:41Z","body":"Hello,\n\nI'm getting failed SSL connections when running on MS Windows, while the same setup seems to be working fine on Linux.\n\nMy setup is:\n- Windows 10 64bit\n- `ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]`\n- DevKit-mingw64-64-4.7.2-20130224-1432-sfx\n- [OpenSSL 1.0.1m](http://dl.bintray.com/oneclick/OpenKnapsack/x64/:openssl-1.0.1m-x64-windows.tar.lzma)\n- Puma 2.15.3\n## Installation\n\nI copied the `.dlls` under OpenSSL's `bin/` to Ruby's `bin/` (I had to replace the ones already there) before installing Puma with:\n\n```\n> gem install puma -- --with-opt-dir=C:\\openssl\nFetching: puma-2.15.3.gem (100%)\nTemporarily enhancing PATH to include DevKit...\nBuilding native extensions with: '--with-opt-dir=C:\\openssl'\nThis could take a while...\nSuccessfully installed puma-2.15.3\nParsing documentation for puma-2.15.3\nInstalling ri documentation for puma-2.15.3\nDone installing documentation for puma after 5 seconds\n1 gem installed\n```\n## Server\n\n``` ruby\nrequire 'puma'\n\nclass HelloWorld\n    def call( env )\n        [\n            200,\n            {\n                \"Content-Type\" => \"text/html\"\n            },\n            [\"Hello World!\"]\n        ]\n    end\nend\n\nserver = Puma::Server.new( HelloWorld.new )\nserver.min_threads = 0\nserver.max_threads = 16\n\noptions = {\n    bind: '0.0.0.0',\n    port: 9999\n}\n\nctx = Puma::MiniSSL::Context.new\nctx.key  = \"spec/support/pems/server/key.pem\"\nctx.cert = \"spec/support/pems/server/cert.pem\"\n\nserver.binder.add_ssl_listener( options[:bind], options[:port], ctx )\n\nputs \"Listening on https://#{options[:bind]}:#{options[:port]}\"\n\nbegin\n    server.run.join\nrescue Interrupt\n    server.stop( true )\nend\n```\n\nPEMs:\n- [key](https://github.com/Arachni/arachni/tree/master/spec/support/pems/server/key.pem)\n- [cert](https://github.com/Arachni/arachni/tree/master/spec/support/pems/server/cert.pem)\n## Trigger\n\n```\n> curl -vvv https://127.0.0.1:9999/ -k\n*   Trying 127.0.0.1...\n* Connected to 127.0.0.1 (127.0.0.1) port 9999 (#0)\n* TLSv1.0, TLS handshake, Client hello (1):\n* TLSv1.0, TLS handshake, Server hello (2):\n* TLSv1.0, TLS handshake, CERT (11):\n* TLSv1.0, TLS handshake, Server key exchange (12):\n* TLSv1.0, TLS handshake, Server finished (14):\n* TLSv1.0, TLS handshake, Client key exchange (16):\n* TLSv1.0, TLS change cipher, Client hello (1):\n* TLSv1.0, TLS handshake, Finished (20):\n* Unknown SSL protocol error in connection to 127.0.0.1:9999\n* Closing connection 0\ncurl: (35) Unknown SSL protocol error in connection to 127.0.0.1:9999\n```\n\n```\ncurl 7.40.0 (x86_64-pc-win32) libcurl/7.40.0 OpenSSL/1.0.0o zlib/1.2.8 WinIDN libssh2/1.4.3 librtmp/2.3\nProtocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp\nFeatures: AsynchDNS IDN Largefile SSPI Kerberos SPNEGO NTLM SSL libz\n```\n"},"comment":{"url":"https://api.github.com/repos/puma/puma/issues/comments/321970784","html_url":"https://github.com/puma/puma/issues/829#issuecomment-321970784","issue_url":"https://api.github.com/repos/puma/puma/issues/829","id":321970784,"user":{"login":"preetpalS","id":6419959,"avatar_url":"https://avatars3.githubusercontent.com/u/6419959?v=4","gravatar_id":"","url":"https://api.github.com/users/preetpalS","html_url":"https://github.com/preetpalS","followers_url":"https://api.github.com/users/preetpalS/followers","following_url":"https://api.github.com/users/preetpalS/following{/other_user}","gists_url":"https://api.github.com/users/preetpalS/gists{/gist_id}","starred_url":"https://api.github.com/users/preetpalS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preetpalS/subscriptions","organizations_url":"https://api.github.com/users/preetpalS/orgs","repos_url":"https://api.github.com/users/preetpalS/repos","events_url":"https://api.github.com/users/preetpalS/events{/privacy}","received_events_url":"https://api.github.com/users/preetpalS/received_events","type":"User","site_admin":false},"created_at":"2017-08-12T09:59:36Z","updated_at":"2017-08-12T09:59:36Z","body":"@evanphx I also experienced this issue with Puma (puma (3.9.1)) with Ruby 2.4.1 (x64) on Windows. Using Puma (puma (3.9.1-java)) with JRuby 9.1.9.0, I did not encounter this problem (the app was able to serve pages over HTTPS).\r\n\r\n@vais If your application runs on JRuby, then you can use Puma with SSL on Windows.\r\n\r\nThe following is my Puma config:\r\n\r\n```\r\nbind 'ssl://192.168.1.50:443?key=cert.key&cert=cert.crt&verify_mode=none'\r\n\r\n# Working JRuby HTTPS config\r\n# bind 'ssl://192.168.1.50:443?keystore=cert.jks&keystore-pass=password&cert.key&cert=cert.crt&verify_mode=none'\r\n```\r\n\r\nTesting failing version (Puma 3.9.1 on Ruby 2.4.1 (x64)) with Curl (mingw64):\r\n\r\n```\r\n$ curl -vvv https://192.168.1.50/ -k\r\n* STATE: INIT => CONNECT handle 0x600057470; line 1418 (connection #-5000)\r\n* Added connection 0. The cache now contains 1 members\r\n*   Trying 192.168.1.50...\r\n* TCP_NODELAY set\r\n* STATE: CONNECT => WAITCONNECT handle 0x600057470; line 1471 (connection #0)\r\n* Connected to 192.168.1.50 (192.168.1.50) port 443 (#0)\r\n* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x600057470; line 1588 (connection #0)\r\n* Marked for [keep alive]: HTTP default\r\n* ALPN, offering http/1.1\r\n* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH\r\n* successfully set certificate verify locations:\r\n*   CAfile: /usr/ssl/certs/ca-bundle.crt\r\n  CApath: none\r\n* TLSv1.2 (OUT), TLS header, Certificate Status (22):\r\n* TLSv1.2 (OUT), TLS handshake, Client hello (1):\r\n* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x600057470; line 1602 (connection #0)\r\n* TLSv1.2 (IN), TLS handshake, Server hello (2):\r\n* TLSv1.2 (IN), TLS handshake, Certificate (11):\r\n* TLSv1.2 (IN), TLS handshake, Server key exchange (12):\r\n* TLSv1.2 (IN), TLS handshake, Server finished (14):\r\n* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):\r\n* TLSv1.2 (OUT), TLS change cipher, Client hello (1):\r\n* TLSv1.2 (OUT), TLS handshake, Finished (20):\r\n* TLSv1.2 (IN), TLS change cipher, Client hello (1):\r\n* TLSv1.2 (IN), TLS handshake, Finished (20):\r\n* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384\r\n* ALPN, server did not agree to a protocol\r\n* Server certificate:\r\n*  subject: C=XX; ST=XX; L=XX; O=XX; CN=XX\r\n*  start date: Aug 12 04:49:02 2017 GMT\r\n*  expire date: Aug 10 04:49:02 2027 GMT\r\n*  subject: C=XX; ST=XX; L=XX; O=XX; CN=XX\r\n*  SSL certificate verify result: self signed certificate (18), continuing anyway.\r\n* STATE: PROTOCONNECT => DO handle 0x600057470; line 1623 (connection #0)\r\n> GET / HTTP/1.1\r\n> Host: 192.168.1.50\r\n> User-Agent: curl/7.53.1\r\n> Accept: */*\r\n>\r\n* STATE: DO => DO_DONE handle 0x600057470; line 1685 (connection #0)\r\n* STATE: DO_DONE => WAITPERFORM handle 0x600057470; line 1812 (connection #0)\r\n* STATE: WAITPERFORM => PERFORM handle 0x600057470; line 1822 (connection #0)\r\n* SSL read: error:00000000:lib(0):func(0):reason(0), errno 104\r\n* Marked for [closure]: Transfer returned error\r\n* multi_done\r\n* Closing connection 0\r\n* The cache now contains 0 members\r\n* Expire cleared\r\ncurl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104\r\n```"}}
{"actor":{"display_login":"preetpalS"}}