# SMT: Fun with the server certificate

**URL:** <https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537>\
**Category:** SLES Configure-Administer\
**Created:** [February 14, 2019, 10:19am UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537 "2019-02-14T10:19:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bausch](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@bausch](https://forums.suse.com/u/bausch)\
**Post date:** [February 14, 2019, 10:19am UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/1 "2019-02-14T10:19:06Z")

</div>

I have an SMT server whose hostname is “smt”. Using yast ca\_mgm, I create a certificate for it, whose common name is “smt”.

On the SMT client, I run clientSetup4SMT.sh. After accepting the certificate and agreeing to start the registration, I get this error message:

`/usr/bin/SUSEConnect --write-config --url https://smt/center/regsvc
SUSEConnect error: OpenSSL::SSL::SSLError: hostname "smt" does not match the server certificate`

I found that the message is generated in Ruby SSL code, but I don’t know enough of Ruby to understand what exactly is checked.

Funnily, neither curl nor wget complain about the certificate when they access [https://smt](https://smt).

I also try to use Yast to accomplish registration, and I get “Permission to access ‘[http://smt/repo/repoindex.xml?cookies=0&credentials=SMT-http\_smt](http://smt/repo/repoindex.xml?cookies=0&credentials=SMT-http_smt)’ denied.” There is no repoindex.xml file under the repo directory - do I have to create one?

Where does the mismatch between hostname and certificate come from? Where can I find more information?  
Is the Yast error related to the certificate error? If not, how can I address it?

---

<div class="post-metadata">

**Author:** ![thsundel](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@thsundel](https://forums.suse.com/u/thsundel)\
**Post date:** [February 14, 2019, 10:38am UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/2 "2019-02-14T10:38:14Z")

</div>

[QUOTE=bausch;56644]I have an SMT server whose hostname is “smt”. Using yast ca\_mgm, I create a certificate for it, whose common name is “smt”.

On the SMT client, I run clientSetup4SMT.sh. After accepting the certificate and agreeing to start the registration, I get this error message:

`/usr/bin/SUSEConnect --write-config --url https://smt/center/regsvc
SUSEConnect error: OpenSSL::SSL::SSLError: hostname "smt" does not match the server certificate`

I found that the message is generated in Ruby SSL code, but I don’t know enough of Ruby to understand what exactly is checked.

Funnily, neither curl nor wget complain about the certificate when they access [https://smt](https://smt).

I also try to use Yast to accomplish registration, and I get “Permission to access ‘[http://smt/repo/repoindex.xml?cookies=0&credentials=SMT-http\_smt](http://smt/repo/repoindex.xml?cookies=0&credentials=SMT-http_smt)’ denied.” There is no repoindex.xml file under the repo directory - do I have to create one?

Where does the mismatch between hostname and certificate come from? Where can I find more information?  
Is the Yast error related to the certificate error? If not, how can I address it?[/QUOTE]

All over in the docs it states to use FQDN, so I would suggest reinstalling SMT using smt.yourdomain.abc and see if that helps.

Thomas

---

<div class="post-metadata">

**Author:** ![bausch](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@bausch](https://forums.suse.com/u/bausch)\
**Post date:** [February 14, 2019, 10:57am UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/3 "2019-02-14T10:57:37Z")

</div>

Thanks, I will try that.

Does reinstalling SMT require mirroring the repos again or is there a way to avoid that?

---

<div class="post-metadata">

**Author:** ![bausch](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@bausch](https://forums.suse.com/u/bausch)\
**Post date:** [February 14, 2019, 12:52pm UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/4 "2019-02-14T12:52:00Z")

</div>

I reinstalled SMT and was delighted to see that the repos I had mirrored earlier are still mirrored.

On the other hand, I get the same error when setting up the client. I created a new certificate with FQDN as common name, and the message complains that the FQDN doesn’t match the server certificate.

What does “match” mean anyway?

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [February 14, 2019, 1:30pm UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/5 "2019-02-14T13:30:29Z")

</div>

As part of Public Key Infrastructure (PKI) which is the infrastructure of  
public keys, certificate authorities (CA), and relies on other protocols  
like Domain Name Service (DNS), one of the most basic checks is that the  
address the client was given (by you) matches the Subject line of the  
certificate that the server presents.

In your original post you were going to [https://smt/](https://smt/) meaning you are  
telling your system to somehow resolve ‘smt’ to an IP address, and then  
the TLS layer is going to confirm that the certificate coming from that IP  
address has a Subject, or Subject Alternative Name (SAN), of ‘smt’ ‘smt’  
is not a valid DNS address, as it has no domain component, so now  
presumably you have fixed the SMT side by having smt.your-organization.tld  
or something, but your client is still being told to go to ‘smt’.

While using simple hostnames is sometimes appealing because of its  
brevity, at the end of the day it i snot valid in DNS, so you should  
always use a proper DNS name, e.g. smt.your-organization.tld, when putting  
addresses in places, so the systems can do proper verification of  
certificates. Otherwise, while you may have encrypted connections, they  
are no more secure than an attacker’s bogus certificate; the data may be  
secure from onlookers, but you’re still having a conversation directly  
with an attacker, and the client, unless it errors as it is in your case,  
has no way of trusting a valid server while rejecting a malicious one,  
meaning no security.

See if changing your SUSEConnect parameter helps. If you do not have an  
actual DNS entry for the full address, you’ll need to fix that in DNS first.

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

**Author:** ![bausch](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@bausch](https://forums.suse.com/u/bausch)\
**Post date:** [February 15, 2019, 2:03am UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/6 "2019-02-15T02:03:43Z")

</div>

I solved the problem by creating everything, including operating system and mirrored repository, from scratch.

---

<div class="post-metadata">

**Author:** ![bausch](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@bausch](https://forums.suse.com/u/bausch)\
**Post date:** [February 15, 2019, 2:09am UTC](https://forums.suse.com/t/smt-fun-with-the-server-certificate/33537/7 "2019-02-15T02:09:39Z")

</div>

Well, my hope was that by re-creating the certificate in Yast I would have a valid certificate. This was not the case (except that curl and wget seemed to be happy). I just gave up trying to understand all this and started from scratch, i.e. installing the OS. The certificate is working now, but my SMT saga continues:

```auto
# smt-staging createrepo SLES12-SP3-Updates sle-12-x86_64 --testing
(...)
Repository successfully generated at /repo/testing/SUSE/Updates/SLE-SERVER/12-SP3/x86_64/update/.
# smt-staging createrepo SLES12-SP3-Updates sle-12-x86_64 --production
Testing repository does not exist or is not generated properly, cannot generate production repository.
Generate the testing repository first.
```

I will create a new question if I don’t find a solution here.
