This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 963419 - RHC unable to upload custom ssl
RHC unable to upload custom ssl
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-15 14:41 EDT by Diego Castro
Modified: 2015-05-14 22:20 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-10 23:58:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Diego Castro 2013-05-15 14:41:31 EDT
Description of problem:
Unable to add custom ssl via rhc

Version-Release number of selected component (if applicable):
rhc (1.8.9)

How reproducible:
rhc alias-update-cert secure2 secure2.teste.com.br --certificate mysitename.crt --private-key mysitename.key

Result:

/Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/rest/base.rb:21:in `rest_method': No link defined for UPDATE (RuntimeError)
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/rest/alias.rb:20:in `add_certificate'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/commands/alias.rb:81:in `update_cert'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/commands.rb:240:in `send'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/commands.rb:240:in `execute'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/commands.rb:231:in `to_commander'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/command_runner.rb:70:in `run!'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/lib/rhc/cli.rb:36:in `start'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/gems/rhc-1.8.9/bin/rhc:18
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/bin/rhc:19:in `load'
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/bin/rhc:19
	from /Users/diego/.rvm/gems/ruby-1.8.7-p370/bin/ruby_noexec_wrapper:14
Comment 1 joycezhang 2013-05-15 22:55:41 EDT
QE can't reproduce this bug as below:

Build version:
rhc-1.8.9

Step:
1. Add alias to an app
# rhc alias add ruby182 secure2.teste.com.br
Alias 'secure2.teste.com.br' has been added.

2. Update cert to the alias
# rhc alias-update-cert ruby182 secure2.teste.com.br --certificate server.crt --private-key server.key
SSL certificate successfully added.
Comment 2 Clayton Coleman 2013-05-16 09:56:08 EDT
Fixed it so that we use the presence of the UPDATE link to detect whether the certificate can be set. https://github.com/openshift/rhc/pull/385

Please validate that your server supports the UPDATE operation on keys in version 1.4 - we added those two together so it should be supported.
Comment 3 openshift-github-bot 2013-05-16 12:29:52 EDT
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/2911261b4503394598f57731dd5d9cd9b608c069
Bug 963419 - Don't check API versions, check client links
Comment 4 joycezhang 2013-05-17 06:12:37 EDT
Verified this bug with rhc-1.9.2 , the error message is returned when updating certs against a server which can't support SSL as below:

#rhc alias-update-cert app1  secure2.teste.com.br --certificate server.crt --private-key server.key  
The server does not support SSL certificates for custom aliases.
Comment 5 Xiaoli Tian 2013-05-17 06:25:36 EDT
(In reply to comment #4)
> Verified this bug with rhc-1.9.2 , the error message is returned when
> updating certs against a server which can't support SSL as below:
> 
> #rhc alias-update-cert app1  secure2.teste.com.br --certificate server.crt
> --private-key server.key  
> The server does not support SSL certificates for custom aliases.

To simulate the not-supported api by removing or commenting out the following code in /openshift-origin-controller-1.9.2/app/rest_models/rest-alias.rb file and restart broker service

#        "UPDATE" => Link.new("Update alias", "PUT", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/aliases/#{self.id}"),
#          [Param.new("ssl_certificate", "string", "Content of SSL Certificate"), 
#            Param.new("private_key", "string", "Private key for the certificate.  Required if adding a certificate")], 
#            [OptionalParam.new("pass_phrase", "string", "Optional passphrase for the private key")]),

Note You need to log in before you can comment on or make changes to this bug.