Coder Social home page Coder Social logo

CLI options for SSL/TLS about agoo HOT 3 OPEN

noraj avatar noraj commented on June 12, 2024
CLI options for SSL/TLS

from agoo.

Comments (3)

ohler55 avatar ohler55 commented on June 12, 2024 1

Seems reasonable. I'll add those on the next release.

from agoo.

ohler55 avatar ohler55 commented on June 12, 2024

Please try the "in-a-bind" branch. I have not tested the options yet but they should work.

from agoo.

noraj avatar noraj commented on June 12, 2024

In the doc (https://www.rubydoc.info/gems/agoo/2.15.7/Agoo/Server#init-class_method) is not written what format of key/cert is expected?

For example PEM format is crashing agoo:

➜ agoo --ssl_cert /tmp/localhost.crt --ssl_key /tmp/localhost-privateKey.key 
  Running /tmp/localhost.crt
/home/noraj/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/agoo-2.15.7/bin/agoo:217:in `load': --> /tmp/localhost.crt
syntax error, unexpected `BEGIN'
>  1  -----BEGIN CERTIFICATE-----
>  2  MIIDhDCCAmygAwIBAgIEd1OWoDANBgkqhkiG9w0BAQsFADBbMScwJQYDVQQDDB5SZWdlcnkgU2Vs
>  3  Zi1TaWduZWQgQ2VydGlmaWNhdGUxIzAhBgNVBAoMGlJlZ2VyeSwgaHR0cHM6Ly9yZWdlcnkuY29t
>  4  MQswCQYDVQQGEwJVQTAgFw0yMzA5MjcwMDAwMDBaGA8yMTIzMDkyNzE3NTY0MFowRjESMBAGA1UE
>  5  AwwJbG9jYWxob3N0MSMwIQYDVQQKDBpSZWdlcnksIGh0dHBzOi8vcmVnZXJ5LmNvbTELMAkGA1UE
>  6  BhMCVUEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFvg8GmEMgYOPvRnqOAqclj5Qy
>  7  a+vMjLtc6cXS9Aj5Wub3xkLF51HrOsxmZeb0sJQQ4PraLva5loP+PmO91IKkwZqo0ul6YMskZbsc
>  8  cjYvqnK4L43EWVqwBp6W/fmr6FlhBVkNF5KS7YSxMFKx8mp4Hs0BMkSTNLolMjWeOSLLXx7V+POl
>  9  ezupYQJDyLsCRotzzxSSe7+Lb1kwMLTHhpgt/BJ1ws8GTRhXW4GOpB2jzuuZbOX8zMR8u5IGALaL
> 10  XxGkmGBcuo0Y/sxPaIT4c3wNBAcwLSgz+eLgu1bk/ROtteo/FtMemwyJLVRP33oqRnfo/9zhkh0b
> 11  WjwIZof92chRAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1Ud
> 12  DgQWBBQSUU4GTP6YLc/dzoCapxYvz3vxoTAfBgNVHSMEGDAWgBQSUU4GTP6YLc/dzoCapxYvz3vx
> 13  oTANBgkqhkiG9w0BAQsFAAOCAQEAC1mXqOze906c/5Y5X2TUGid3HO/FNcvk9L7Ojk1WYsdavRU9
> 14  o9Il7uthAcP7mKwswkxkwTivNJNQapqa4OtbalSIa5BvpG9bTtIOtfrNPqwY7lXkCnwNskOrpHgP
> 15  ibXNW1lRjXaNNQIYvGBF1tH15lI3ZGXm1zZXQiiZ1vH2hOWoK3ewxoXutVE3LOnsz9Yi5LgSGMyl
> 16  XW6dTfx3VbdpMR8d3hy7Y/OP5P/s50gIYnC7CLwuW36XLsjMIoD4mUjRvW20afWXYgvv9XBcnlE0
> 17  tvAa8QNvnK+6mFo0hdg4SY1/g7Hm2KlCLgCeLQ9MkY2VhQ9GpWRYhJS58SLL1rwafQ==
> 18  -----END CERTIFICATE-----
/tmp/localhost.crt:1: syntax error, unexpected `BEGIN' (SyntaxError)
-----BEGIN CERTIFICATE-----
     ^~~~~

        from /home/noraj/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/agoo-2.15.7/bin/agoo:217:in `<top (required)>'
        from /home/noraj/.asdf/installs/ruby/3.2.2/bin/agoo:25:in `load'
        from /home/noraj/.asdf/installs/ruby/3.2.2/bin/agoo:25:in `<main>'
➜ file /tmp/localhost.crt       
/tmp/localhost.crt: PEM certificate

➜ file /tmp/localhost-privateKey.key                  
/tmp/localhost-privateKey.key: PEM RSA private key

That's weird because it works with the lib:

irb(main):006:0> Agoo::Server.init(6464, 'root', bind: 'https://127.0.0.1:4343', ssl_cert: '/tmp/localhost.crt', ssl_key: '/tmp/localhost-privateKey.key')
=> nil
irb(main):007:0> Agoo::Server.start()
I 2023/09/27 20:10:49.813474256 INFO: Agoo 2.15.7 with pid 40016 is listening on http://:6464.
I 2023/09/27 20:10:49.813484856 INFO: Agoo 2.15.7 with pid 40016 is listening on https://127.0.0.1:4343.

from agoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.