Heroku错误:主机名与服务器证书不匹配

时间:2016-04-20 00:51:13

标签: heroku ssh key

我试图按照Spring Boot in Action第8章中的说明在Heroku上设置Spring Boot应用程序。首先,我使用项目基目录中的命令“git init”将项目目录初始化为git存储库。然后我发出命令“heroku apps:create sbia-mhtdemo”。我收到了以下回复:

 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       hostname was not match with the server certificate (OpenSSL::SSL::SSLError) (Excon::Errors::SocketError)
    Backtrace:   /Users/mhtbk/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/openssl/ssl-internal.rb:121:in `post_connection_check'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/ssl_socket.rb:86:in `initialize'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/connection.rb:410:in `new'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/connection.rb:410:in `socket'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/connection.rb:122:in `request_call'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/middlewares/mock.rb:42:in `request_call'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/middlewares/base.rb:15:in `request_call'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/middlewares/base.rb:15:in `request_call'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/middlewares/base.rb:15:in `request_call'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/connection.rb:265:in `request'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/lib/heroku/client/organizations.rb:31:in `request'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/lib/heroku/client/organizations.rb:76:in `get_orgs'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/lib/heroku/command/base.rb:53:in `org'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/lib/heroku/command/apps.rb:237:in `create'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/lib/heroku/command.rb:218:in `run'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/lib/heroku/cli.rb:28:in `start'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/gems/heroku-3.2.2/bin/heroku:17:in `<top (required)>'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/bin/heroku:19:in `load'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/bin/heroku:19:in `<main>'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/bin/ruby_executable_hooks:15:in `eval'
                 /Users/mhtbk/.rvm/gems/ruby-1.9.2-p320/bin/ruby_executable_hooks:15:in `<main>'

    Command:     heroku apps:create sbia-mhtdemo
    Version:     heroku-gem/3.2.2 (x86_64-darwin12.5.0) ruby/1.9.2

我的系统上只有一个密钥,它与我用于Git帐户和Heroku帐户的密钥相同。我还尝试通过命令“ssh -v git@heroku.com”验证我的密钥。我得到以下输出:

OpenSSH_5.9p1, OpenSSL 0.9.8zg 14 July 2015
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug1: Connecting to heroku.com [50.19.85.156] port 22.
debug1: Connection established.
debug1: identity file /Users/mhtbk/.ssh/id_rsa type 1
debug1: identity file /Users/mhtbk/.ssh/id_rsa-cert type -1
debug1: identity file /Users/mhtbk/.ssh/id_dsa type -1
debug1: identity file /Users/mhtbk/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version endosome
debug1: no match: endosome
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad
debug1: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in /Users/mhtbk/.ssh/known_hosts:6
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/mhtbk/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: read PEM private key done: type RSA
Identity added: /Users/mhtbk/.ssh/id_rsa (/Users/mhtbk/.ssh/id_rsa)
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to heroku.com ([50.19.85.156]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
PTY allocation request failed on channel 0
shell request failed on channel 0

基于“debug1:提供RSA public ....”和“Authenticated succeeded ...”这一行似乎密钥有效,尽管上面的服务器主机密钥指纹与我的公钥指纹不匹配。我在Heroku的帮助下四处寻找,但我不确定究竟是什么问题。

1 个答案:

答案 0 :(得分:0)

我找到了答案,就像更新我的Heroku工具带版本一样简单,我有一段时间没用过它,它有点过时了。