Bug 1922944

Summary: Global Registration: Getting "curl:(51)" error while registering with Curl command but registration with activation key works.
Product: Red Hat Satellite Reporter: Akshay Kapse <akapse>
Component: RegistrationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Stephen Wadeley <swadeley>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: ahumbe, lstejska
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-05 12:43:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Akshay Kapse 2021-02-01 07:30:02 UTC
Description of problem:
While registering host with Global Registration Curl getting error:
~~~
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate." 
~~~
But no error while registering with activation key.

Steps to Reproduce:
1. Generate the Global Registration Curl command:

~~~
curl -X GET "https://satellite.example.com/register?activation_key=ak1&location_id=2&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTIxNjM2NDksImp0aSI6IjJiYzgwMDU3MTU3ZTQzYzUyZGVkYjJkOTgxYWNkYjVmZWM3OWU3ZTRiNGE1YjI1NmUyNmRlNDg0NWNlNDI4ZjYiLCJleHAiOjE2MTIxNzgwNDl9.CvfajFDVXH9f-_VC0LlJh0mQaGUJcmsOsRl1q1L8OWY' | bash
~~~

2. Register the host 

~~~
# curl -X GET "https://satellite.example.com/register?activation_key=ak1&location_id=2&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTIxNjM2NDksImp0aSI6IjJiYzgwMDU3MTU3ZTQzYzUyZGVkYjJkOTgxYWNkYjVmZWM3OWU3ZTRiNGE1YjI1NmUyNmRlNDg0NWNlNDI4ZjYiLCJleHAiOjE2MTIxNzgwNDl9.CvfajFDVXH9f-_VC0LlJh0mQaGUJcmsOsRl1q1L8OWY' | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.
~~~

3. If same host is registered using activation key:
~~~
# subscription-manager register --org="Default_Organization" --activationkey="ak1"
The system has been registered with ID: xxxxxxx-xxxx-xxxxxxx-xxxxxxxxx
~~~


Actual results:
Unable to register host with  Global Registration Curl Command once the host hit error:
~~~
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.
~~~

Expected results:
Registration with Global Registration Curl Command should work if registration with activation key works.

Comment 1 Leos Stejskal 2021-02-05 12:43:52 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1922867#c4

*** This bug has been marked as a duplicate of bug 1922867 ***