Skip to content

oras tries to use http instead of https #1106

Closed

Description

@erikschul

What happened in your environment?

When executing command oras repo ls localhost
I get this error:

Error: Get "http://localhost/v2/_catalog": dial tcp [::1]:80: connect: connection refused

There is no argument for using https, only for using http (--plain-http), so what's going wrong?

What did you expect to happen?

No response

How can we reproduce it?

.

What is the version of your ORAS CLI?

Version: 1.1.0+Homebrew
Go version: go1.21.0

What is your OS environment?

MacOS

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Activity

  1. added
    bug
    on Sep 6, 2023
  2. qweeah commented on Sep 7, 2023

    @qweeah
    Contributor

    @erikschul Thanks for reporting this bug. Confirmed that --plain-http=false doesn't work for localhost

  3. added this to the v1.2.0 milestone on Sep 7, 2023
  4. qweeah commented on Sep 7, 2023

    @qweeah
    Contributor

    @erikschul There is a workaround, you may force the hostname to be not localhost like using --resolve <mock-host>:443:0.0.0.0 as below:

    oras repo ls my.registry --resolve my.registry:443:0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions