SSL Error on HTTP POST (Unknown Protocol)

前端 未结 2 1544
谎友^
谎友^ 2021-02-10 02:40

Trying to connect to Imgur API via SSL gives me an error. Here\'s the code and the error:

  API_URI = URI.parse(\'https://api.imgur.com\')
  API_PUBLIC_KEY = \'C         


        
2条回答
  •  醉梦人生
    2021-02-10 03:07

    For me it was because I had started the server as a http (tcp://) servers instead of https (ssl://).

    i.e.

    bundle exec puma config.ru -b 'tcp://0.0.0.0:3456?key=/path/to/key.key&cert=/path/to/cert.crt'
    

    instead of:

    bundle exec puma config.ru -b 'ssl://0.0.0.0:3456?key=/path/to/key.key&cert=/path/to/cert.crt'
    

提交回复
热议问题