0

wget command fails to download a file with error "The certificate's owner does not match hostname"

Full command output is show below:

wget --continue --directory-prefix=/download https://server.example.com/repo/software-1.0.rpm

Resolving server.example.com (server.example.com)... 10.77.66.27

Connecting to server.example.com (server.example.com)|10.77.66.27|:443... connected.

The certificate's owner does not match hostname ‘server.example.com’

This is on a RedHat 8.6 system and the trust list command does not show any certificate for server.example.com. However there is an entry with label: localhost

  • Where is wget command finding a certificate for the server? Why is this not shown in verbose output?
  • How to print the contents of this certificate or delete it?

1 Answer 1

1

wget is looking at the certificate returned by server.example.com, and apparently that certificate is misconfigured (it is not actually for server.example.com) or you are using the incorrect hostname. This doesn't have anything to do with a certificate stored on your local filesystem.

You can either fix the server, if it's something you control, or you can disable certificate validation with the --no-check-certificate option:

wget --no-check-certificate --continue --directory-prefix=/download \
  https://server.example.com/repo/software-1.0.rpm
1
  • This helped!. Inspecting the server's certificate using the command openssl s_client -connect server.example.com:443 revealed that the CN name in the certificate was wrong. Thanks!
    – Amol
    Sep 22 at 1:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .