Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to use tls when connecting to Hawkular #14054

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

josejulio
Copy link
Member

@josejulio josejulio commented Feb 23, 2017

Support for specifying a secure or non secure connection with or without verifying the identity.

UI PR ManageIQ/manageiq-ui-classic#460

@josejulio
Copy link
Member Author

@miq-bot add-label providers/hawkular

end

def connect(_options = {})
@client ||= self.class.raw_connect(hostname,
port,
authentication_userid('default'),
authentication_password('default'))
authentication_password('default'),
security_protocol,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider explicit default_endpoint.security_protocol.
I think EMS delegating port, security_protocol etc. to default endpoint was put in place mostly for backward compatibility with code written before Endpoint table was extracted, but spelling it out is better and more readable.
[That's why when I added ssl_cert_store to Endpoint, I didn't delegate it from EMS; if you disagree with this reasoning, you may want to delegate that too.]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about that. I was actually wondering about it.
I'll update the code. Thanks.

@@ -55,24 +55,42 @@ def validate_authentication_status
{:available => true, :message => nil}
end

def self.verify_ssl_mode(security_protocol)
case security_protocol
when nil, '', 'non-ssl', 'ssl-without-validation'
Copy link
Contributor

@cben cben Feb 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nil, '' are for treating existing providers as non-ssl, right? Are you planning to migrate existing providers to have non-ssl in DB?
And for 'non-ssl' this value doesn't matter, only using HTTP does, right?
It seems then the handling of nil, '', 'non-ssl' better belongs in entrypoint() when deciding HTTP/HTTPS.

Copy link
Member Author

@josejulio josejulio Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nil, '' are for treating existing providers as non-ssl, right? Are you planning to migrate existing providers to have non-ssl in DB?

I don't have plans for that. Do you think I should?

And for 'non-ssl' this value doesn't matter, only using HTTP does, right?

right

end

def self.entrypoint(host, port, security_protocol)
return URI::HTTP.build(:host => host, :port => port.to_i).to_s if security_protocol == 'non-ssl'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also use HTTP when security_protocol is missing (nil, '')? See also comment in verify_ssl_mode().
I suspect this is why some of your tests failed on missing https:// VCR where they previously worked with http://.

@josejulio josejulio force-pushed the hawkular/add_ssl_support branch from 90cbe35 to 3469919 Compare March 2, 2017 17:40
@josejulio josejulio force-pushed the hawkular/add_ssl_support branch from 3469919 to 9b9a0ab Compare March 2, 2017 17:41
@miq-bot
Copy link
Member

miq-bot commented Mar 2, 2017

Checked commit josejulio@9b9a0ab with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. 🍰

@josejulio
Copy link
Member Author

@cben followed your suggestions, Thank you.

@blomquisg
Copy link
Member

@cben this looks good to me, if you give me a green check mark in the "Reviewers" section, I'll merge this.

@blomquisg blomquisg merged commit cdd2931 into ManageIQ:master Mar 7, 2017
@blomquisg blomquisg added this to the Sprint 56 Ending Mar 13, 2017 milestone Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants