valpackett / freshcerts

ACME certificate protocol (Let's Encrypt) proxy client with a dashboard and monitoring
The Unlicense
60 stars 11 forks source link

OpenSSL::X509::RequestError - header too long #1

Open Fightbackman opened 8 years ago

Fightbackman commented 8 years ago

I'm testing freshcerts for use cases in our server envirorement. I tried to obtain an certificate for one of our subdomains. I was not able to resolve this error to wrong input and think that there is maybe some kind of parsing error or something else. If you need anything else to fix this issue i'll try to make it available asap.

Puma 2.15.3 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://192.168.1.6:9292
192.168.1.2 - - [09/Feb/2016:22:35:12 +0100] "GET /v1/cert/forum.example.de/should_reissue HTTP/1.1" 200 36 0.0091
2016-02-09 22:35:13 - OpenSSL::X509::RequestError - header too long:
        /home/freshcerts/app.rb:66:in `initialize'
        /home/freshcerts/app.rb:66:in `new'
        /home/freshcerts/app.rb:66:in `block in <class:App>'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/logger.rb:15:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:106:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/chunked.rb:54:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:541:in `handle_request'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:388:in `process_client'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:270:in `block in run'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `block in spawn_thread'
NoMethodError: undefined method `name' for nil:NilClass
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:70:in `block in initialize'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `yield'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:369:in `block in visit_Array'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:369:in `each'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:369:in `visit_Array'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:349:in `block in visit_Hash'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:347:in `each'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:347:in `visit_Hash'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:516:in `block in dump_ivars'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:514:in `each'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:514:in `dump_ivars'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:175:in `visit_Object'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
        /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:112:in `push'
        /usr/lib/ruby/2.1.0/psych.rb:409:in `dump'
        /usr/lib/ruby/2.1.0/psych/core_ext.rb:14:in `psych_to_yaml'
        /home/freshcerts/app.rb:24:in `issue_error!'
        /home/freshcerts/app.rb:29:in `block in <class:App>'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `[]'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1134:in `block in error_block!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1131:in `reverse_each'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1131:in `error_block!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1120:in `handle_exception!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1087:in `block in dispatch!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1087:in `rescue in dispatch!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1094:in `dispatch!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/logger.rb:15:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:106:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/chunked.rb:54:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:541:in `handle_request'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:388:in `process_client'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:270:in `block in run'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `call'
        /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `block in spawn_thread'
192.168.1.2 - - [09/Feb/2016:22:35:13 +0100] "POST /v1/cert/forum.example.de/issue HTTP/1.1" 500 220753 0.0589
valpackett commented 8 years ago

Wow, finally someone is interested in freshcerts :-)

Which OpenSSL version is your Ruby using?

Can you send me a CSR you've generated?

On 02/09, Fightbackman wrote:

I'm testing freshcerts for use cases in our server envirorement. I tried to obtain an certificate for one of our subdomains. I was not able to resolve this error to wrong input and think that there is maybe some kind of parsing error or something else. If you need anything else to fix this issue i'll try to make it available asap.

Puma 2.15.3 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://192.168.1.6:9292
192.168.1.2 - - [09/Feb/2016:22:35:12 +0100] "GET /v1/cert/forum.example.de/should_reissue HTTP/1.1" 200 36 0.0091
2016-02-09 22:35:13 - OpenSSL::X509::RequestError - header too long:
       /home/freshcerts/app.rb:66:in `initialize'
       /home/freshcerts/app.rb:66:in `new'
       /home/freshcerts/app.rb:66:in `block in <class:App>'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/logger.rb:15:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:106:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/chunked.rb:54:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:541:in `handle_request'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:388:in `process_client'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:270:in `block in run'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `block in spawn_thread'
NoMethodError: undefined method `name' for nil:NilClass
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:70:in `block in initialize'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `yield'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:72:in `block in initialize'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `yield'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:369:in `block in visit_Array'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:369:in `each'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:369:in `visit_Array'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:349:in `block in visit_Hash'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:347:in `each'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:347:in `visit_Hash'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:516:in `block in dump_ivars'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:514:in `each'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:514:in `dump_ivars'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:175:in `visit_Object'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:148:in `accept'
       /usr/lib/ruby/2.1.0/psych/visitors/yaml_tree.rb:112:in `push'
       /usr/lib/ruby/2.1.0/psych.rb:409:in `dump'
       /usr/lib/ruby/2.1.0/psych/core_ext.rb:14:in `psych_to_yaml'
       /home/freshcerts/app.rb:24:in `issue_error!'
       /home/freshcerts/app.rb:29:in `block in <class:App>'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `[]'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1134:in `block in error_block!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1131:in `reverse_each'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1131:in `error_block!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1120:in `handle_exception!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1087:in `block in dispatch!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1087:in `rescue in dispatch!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1094:in `dispatch!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/logger.rb:15:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:106:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/chunked.rb:54:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:541:in `handle_request'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:388:in `process_client'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/server.rb:270:in `block in run'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `call'
       /home/freshcerts/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/thread_pool.rb:106:in `block in spawn_thread'
192.168.1.2 - - [09/Feb/2016:22:35:13 +0100] "POST /v1/cert/forum.example.de/issue HTTP/1.1" 500 220753 0.0589
```bash

---
Reply to this email directly or view it on GitHub:
https://github.com/myfreeweb/freshcerts/issues/1
Fightbackman commented 8 years ago

Hi. First thank you for your fast answer. Freshcerts is just the thing I'm looking for to manage my certificates for 28 domains on an centralized and comfortable way. The OpenSSL version is 1.0.1k on Debian Jessie. Do you mean just a manually generated csr file or a csr generated by freshcerts? And if it is so, how can I get the csr from freshcerts. I'm a real noob in ruby and don't realy understand what happends in the app.rb for generating the csr.

Greets

valpackett commented 8 years ago

No, freshcerts doesn't generate CSRs, it reads them!

You're using the freshcerts-client script, right? It generates the CSR using the openssl command.

On 02/09, Fightbackman wrote:

Hi. First thank you for your fast answer. Freshcerts is just the thing I'm looking for to manage my certificates for 28 domains on an centralized and comfortable way. The OpenSSL version is 1.0.1k on Debian Jessie. Do you mean just a manually generated csr file or a csr generated by freshcerts? And if it is so, how can I get the csr from freshcerts. I'm a real noob in ruby and don't realy understand what happends in the app.rb for generating the csr.

Greets


Reply to this email directly or view it on GitHub: https://github.com/myfreeweb/freshcerts/issues/1#issuecomment-182104667

Fightbackman commented 8 years ago

I made everystep from the script in the terminal. That ist the generated csr:

-----BEGIN CERTIFICATE REQUEST----- MIIEbjCCAlYCAQAwKTEnMCUGA1UEAwweZm9ydW0uaW1wZXJpYWxlLWhlZXJzY2hh cmVuLmRlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA5b93LwKg4T78 c+5HOYqhCm2zOTlepVTjCGnTwhAZS9bx18jjM4mSCLegSs8G54sCAP5yMzDOfAkz UxJ1QgLunoTmtEAn0ri6TyWDUUNybE3OIN/h6+19Mvgypg6WFE5h0Us++VZI8JUm sBcoWh0KYtXTl4tHBEpLArHUs8tEjjrqVgLkePnEzGXSlQXc4QORA3e6IZWQxfnA pwTDSuk2j1A7DDieepgbAjiAjtwfgoNsGky9h40Cnx2nsVem5ieHETbvrGIrrJ03 yHDWq7WvWugiEj1MxZKkLaiTasAwKsYBpd6FoSJLA/2FJYT3uYRLWAwjcwMCDCKI /gaao5gp76itfLObeEh15fqSlNCfA9P4/+VOgi21Jt5iAA8PqQhsoAFuWM11RHqk I+1bYwQEGOvwgztVKiQseGHnPRJga/VgG92ArhIoj+zr5yaxy7vSGjxVTHnv5M08 qaRvgCEqpb7HfpA8kDy5SX6lFBPxrxuIgwFDVZlxzwGTVrHVPtHvNnQgTBOJ46HK bzBS98R7N3AmRp0axBEqLj7MVyqxa70Doeqpb5kldWBIS8EajRf5ysXkTEeQ9UkY I1dPtGrWitUTWDq1oMDQCj4V8uBYn7Tp2agd13iHR1jMWN8cpA7sJJykxBVNIRfP Lkh/gCprF2h6y046sc+qDg2bjRDjtrcCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IC AQByp0YHRLvlvlyL5mt9Q4w/hLbIir/NF3WvtwcOlnxHK89uW94G5k/BPoiVmgu4 jdxyQz7F2C5i1Vd53NsFgIBrq3zaEWGiv1b08xc2vKu9pJwn4brbZKfgArfefRQm 9e+XpClddFNHjDndvPblWuH6YiN3e9PnZjHAMzlkPUDxiAK5d68rsRPj6gJStJ8G UO9qi+xm26JNEkAuvGg1zIug0seVk9o0J60ue8VF31XxuxuJ3Ey2lCm9ESROsZZr woTzpROodP23WqNveqttf6MOw97VV8TGkT3dYApv9XKkpQjuwkWbn/Wf26zWQv+J RYAA+Mh4ZWsNYFZqr+s+MfuZRAGFgWBQOSdaBGThWIQ8FJQS1GSyumxrQhj+kgqk 39lSHwrznLoRvR9EJwSt0P8wyY1rwH3vEX4ZKZ5Ym1RVBfc/wayx24Qon/ZspWJa iFKhdzqVUDMCke8O1oWEVbpFNPjHYjSX0nIqywPyKfSAiuVy0D0rHrJqhxKog5la zQf1+PWGiWKG7hPXEhQK3ygDWwxwteRM55QtqUwozV95lk37vP3Ghs/WXrP2Yu5K mc2hwlxELqk+CZTP97U6g7Hx1tNMf0wjba7Z8AfHtMirqK4w+CqIOwiklZSFVphH avGrKJk/L/qWDsY7IhnWXwtBU3qHzgnhbPTdJ2INnDbWMQ== -----END CERTIFICATE REQUEST-----

valpackett commented 8 years ago

The CSR is fine. This is really weird…

Can you read it from Ruby? e.g. if you save it as test.csr:

ruby -e "require 'openssl'; p OpenSSL::X509::Request.new File.read 'test.csr'"
Fightbackman commented 8 years ago

The generated output by the command you posted above:

OpenSSL::X509::Request:0x00000001eccee8

valpackett commented 8 years ago

Hmm, so it's not an OpenSSL issue. Maybe there's something going on with file uploads :(

Fightbackman commented 8 years ago

I tried to figure it out in detail. Maybe there is a problem with curl? I tried to run the curl statements on it own, replacing the variables with hardcoded entries:


 curl -f "192.168.1.6:9292/v1/cert/forum.imperiale-heerscharen.de/should_reissue" 2>/dev/null && \
        openssl genrsa -out "/home/lukas/temp/forum.imperiale-heerscharen.de.key.pem" 4096 2>/dev/null && \
        openssl req -new -batch -subj "/C=forum.imperiale-heerscharen.de" -key "/home/lukas/temp/forum.imperiale-heerscharen.de.key.pem" -out "/home/lukas/temp/forum.imperiale-heerscharen.de.csr"  | \
        curl -s -X POST "192.168.1.6:9292/v1/cert/forum-imperiale-heerscharen.de/issue" \
                -F "csr=@-" -F "ports=9292" -F "domain=forum.imperiale-heerscharen.de" -F "token=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJmcmVzaGNlcnRzIiwiaW5mbyI6IiJ9.6hkqR4w9RBbB9UAnGtQb9uhLfuZrA6QXcy41pM8owLSjdAFKtTSOEsEHjDoECP7Wq0be7ZuqihYnxf8DLigISg" > output.txt

Attached is the output from the command. Maybe this helps you to detect the error. Everything is from a testing enviroment so it is not importan for security.

output.txt

valpackett commented 8 years ago

The output is, of course, the same stack traces as in the log.

I've found the YAML-related exception, it's tenderlove/psych#100. The built-in version of psych in your Ruby doesn't contain the fix. I've added psych to the gemfile, pull the repo & run bundle install, then try again. At least that exception should be gone.

(Why ports=9292? Are you running your TLS on that port, not 443? It should be the port of the thing you're getting the cert for. Is the README not clear enough about that?)