[openstack-dev] [Openstack] [nova][api] Novaclient redirect endpoint https into http

Ghanshyam Mann gmann at ghanshyammann.com
Fri Jul 6 03:01:23 UTC 2018




 ---- On Fri, 06 Jul 2018 11:30:15 +0900 Alex Xu <soulxu at gmail.com> wrote ---- 
 > 
 > 
 > 2018-07-06 10:03 GMT+08:00 Alex Xu <soulxu at gmail.com>:
 > 
 > 
 > 2018-07-06 2:55 GMT+08:00 melanie witt <melwittt at gmail.com>:
 > +openstack-dev@
 >  
 >  On Wed, 4 Jul 2018 14:50:26 +0000, Bogdan Katynski wrote:
 >   But, I can not use nova command, endpoint nova have been redirected from https to http. Here:http://prntscr.com/k2e8s6  (command: nova –insecure service list)
 >   First of all, it seems that the nova client is hitting /v2.1 instead of /v2.1/ URI and this seems to be triggering the redirect.
 >  
 >  Since openstack CLI works, I presume it must be using the correct URL and hence it’s not getting redirected.
 >  
 >     And this is error log: Unable to establish connection tohttp://192.168.30.70:8774/v2.1/: ('Connection aborted.', BadStatusLine("''",))
 >    
 >   Looks to me that nova-api does a redirect to an absolute URL. I suspect SSL is terminated on the HAProxy and nova-api itself is configured without SSL so it redirects to an http URL.
 >  
 >  In my opinion, nova would be more load-balancer friendly if it used a relative URI in the redirect but that’s outside of the scope of this question and since I don’t know the context behind choosing the absolute URL, I could be wrong on that.
 >   
 >  Thanks for mentioning this. We do have a bug open in python-novaclient around a similar issue [1]. I've added comments based on this thread and will consult with the API subteam to see if there's something we can do about this in nova-api.

We can support both URL for version API in that case ( /v2.1 and /v2.1/ ). Redirect from relative to obsolete can be changed to  map '' to 'GET': [version_controller, 'show'] route, something like [1]. 

[1] https://review.openstack.org/#/c/580544/

-gmann

 >  
 > 
 > Emm...check with the RFC, it said the value of Location header is absolute URL https://tools.ietf.org/html/rfc2616.html#section-14.30
 > Sorry, correct that. the RFC7231 updated that. The relativeURL is ok. https://tools.ietf.org/html/rfc7231#section-7.1.2   -melanie
 >  
 >  [1] https://bugs.launchpad.net/python-novaclient/+bug/1776928
 >  
 >  
 >  
 >  
 >  __________________________________________________________________________
 >  OpenStack Development Mailing List (not for usage questions)
 >  Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
 >  http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 >  
 >  
 >  __________________________________________________________________________
 > OpenStack Development Mailing List (not for usage questions)
 > Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
 > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 > 





More information about the OpenStack-dev mailing list