Results 1 to 6 of 6

Thread: zypper https urls: Protocol "http" not supported or disabled in libcurl

  1. #1

    Default zypper https urls: Protocol "http" not supported or disabled in libcurl

    Hi,

    The story which leads to the question: I am packaging the tool mkosi which creates an OS image, using zypper.

    So I hope this the correct place to ask for help on zypper/curl.

    mkosi uses /var/tmp/mkosi-3new2jrs/root/ as root for the new image, then it adds some repos with zypper. So in this example the command looks like:
    Code:
    zypper --root /var/tmp/mkosi-3new2jrs/root addrepo -ck https://download.opensuse.org/update/tumbleweed/ Updates
    However this fails:
    Code:
    Adding repository 'Updates' -------------------------------------------------------------------------------------------------------------------------------[\]
    Download (curl) error for 'https://download.opensuse.org/update/tumbleweed/repodata/repomd.xml':
    Error code:  Bad URL
    Error message: Protocol "http" not supported or disabled in libcurl
    
    Abort, retry, ignore? [a/r/i/...? shows all options] (a):
    Somehow this does not support HTTPS, it works with the HTTP protocol. However, not using the --root flag works fine. So zypper itself seems to support it.

    To reproduce, you can install the package mkosi in TW and replace http://download.opensuse.org with https://download.opensuse.org in /usr/bin/mkosi (The shipped version uses HTTP instead of the preferred HTTPS).

    Do you have any idea what prevents zypper/curl from supporting HTTPS? /var/tmp/mkosi-3new2jrs/root/ there is no /etc/, only /var/{cache,lib,log,run}

  2. #2

    Default Re: zypper https urls: Protocol "http" not supported or disabled in libcurl

    Quote Originally Posted by sebix View Post
    Do you have any idea what prevents zypper/curl from supporting HTTPS?
    It's a server "problem" I think. The error message is just misleading...

    See https://forums.opensuse.org/showthre...30#post2838330

    To repeat the relevant part here:
    Code:
    $ curl https://download.opensuse.org/repositories/KDE:Extra/openSUSE_Leap_42.3/KDE:Extra.repo
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>301 Moved Permanently</title>
    </head><body>
    <h1>Moved Permanently</h1>
    <p>The document has moved <a href="http://download.opensuse.org/repositories/KDE:/Extra/
    openSUSE_Leap_42.3/KDE:Extra.repo">here</a>.</p>
    <hr>
    <address>Apache/2.2.34 (Linux/SUSE) Server at download.opensuse.org Port 443</address>
    </body></html>

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: zypper https urls: Protocol "http" not supported or disabled in libcurl

    In the zypper scripts I've written,
    I've likely avoided this by simply invoking "su" or "sudo" instead.
    In fact this practice more or less motivates me to properly modularize my code into indivdual sub-scripts, each running with a specific security context, making it more unwieldy to write spaghetti code (which would be easier to do if all I had to do was invoke a --root flag in a command).

    IMO/HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4

    Default Re: zypper https urls: Protocol "http" not supported or disabled in libcurl

    Thanks for your help!

    What's puzzling me is that other URLs work:

    Code:
    > sudo zypper ar -c https://download.opensuse.org/tumbleweed/repo/oss/ openSUSE-Tumbleweed-Oss-HTTPS
    Adding repository 'openSUSE-Tumbleweed-Oss-HTTPS' ......................................................................................................[done]
    Repository 'openSUSE-Tumbleweed-Oss-HTTPS' successfully added
    
    URI         : https://download.opensuse.org/tumbleweed/repo/oss/
    Enabled     : Yes                                               
    GPG Check   : Yes                                               
    Autorefresh : No                                                
    Priority    : 99 (default priority)                             
    
    Repository priorities in effect:                                                                                              (See 'zypper lr -P' for details)
          99 (default priority) :  7 repositories
         100 (lowered priority) :  1 repository  
         101 (lowered priority) :  1 repository
    As opposed to:

    Code:
    > sudo zypper addrepo -ck https://download.opensuse.org/update/tumbleweed/ Updates-Test
    Adding repository 'Updates-Test' --------------------------------------------------------------------------------------------------------------------------[\]
    Download (curl) error for 'https://download.opensuse.org/update/tumbleweed/repodata/repomd.xml':
    Error code:  Bad URL
    Error message: Protocol "http" not supported or disabled in libcurl
    
    Abort, retry, ignore? [a/r/i/...? shows all options] (a): a
    Abort, retry, ignore? [a/r/i/...? shows all options] (a):                 
    Adding repository 'Updates-Test' .......................................................................................................................[done]
    Unknown problem when adding repository:
    Unknown error reading from 'https://download.opensuse.org/update/tumbleweed/'
    Repository priorities in effect:                                                                                              (See 'zypper lr -P' for details)
          99 (default priority) :  7 repositories
         100 (lowered priority) :  1 repository  
         101 (lowered priority) :  1 repository

  5. #5
    Join Date
    Sep 2012
    Posts
    7,106

    Default Re: zypper https urls: Protocol "http" not supported or disabled in libcurl

    Quote Originally Posted by sebix View Post
    What's puzzling me is that other URLs work:
    Did you try to actually read the discussion @wolfi323 mentioned?

  6. #6

    Default Re: zypper https urls: Protocol "http" not supported or disabled in libcurl

    Quote Originally Posted by arvidjaar View Post
    Did you try to actually read the discussion @wolfi323 mentioned?
    I only read the mentioned posts, but reading the post after it does explain the problem. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •