Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1661540

Summary: curl: (51) SSL peer certificate or SSH remote key was not OK
Product: Red Hat Enterprise Linux 7 Reporter: Ramesh Sahoo <rsahoo>
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: low    
Version: 7.6CC: kdudka
Target Milestone: rc   
Target Release: 7.6   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-21 12:22:59 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 Ramesh Sahoo 2018-12-21 13:49:31 UTC
Description of problem:

Unable to sftp using curl. 

# curl -vL  -u test sftp://localhost/tmp/
Enter host password for user 'test':
* About to connect() to localhost port 22 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 22 (#0)
* Failed to read known hosts from /root/.ssh/known_hosts
* SSH MD5 fingerprint: 678b4715950cdbe0bc0efc5c1d524a61
* SSH host check: 2, key: <none>
* Closing connection 0
curl: (51) SSL peer certificate or SSH remote key was not OK


Version-Release number of selected component (if applicable):
curl-7.29.0-51.el7.x86_64

Steps to Reproduce:
1. Install curl-7.29.0-51.el7.x86_64 on rhel7.6
2. Execute the following command to confirm the behaviour. 
   # curl -vL  -u test sftp://localhost/tmp/

Additional Info: 
I'm able to take SFTP connection from Fedora28 with curl-7.59.0-9.fc28.x86_64

$ curl -vL -u test sftp://192.168.5.6/tmp/ 
Enter host password for user 'test':
*   Trying 192.168.5.6...
* TCP_NODELAY set
* Connected to 192.168.5.6 (192.168.5.6) port 22 (#0)
* User: test
* Authentication using SSH public key file
* Completed password authentication
* Authentication complete
drwxrwxrwt   14 root     root         4096 Dec 21 19:15 .
dr-xr-xr-x   21 root     root         4096 Dec 19 01:29 ..
drwxrwxrwt    2 root     root            6 Jul  9 19:37 .Test-unix
drwxrwxrwt    2 root     root            6 Sep  3 17:12 .ICE-unix
drwxrwxrwt    2 root     root            6 Jul  9 19:37 .XIM-unix
drwxrwxrwt    2 root     root            6 Jul  9 19:37 .font-unix
drwxrwxrwt    2 root     root            6 Sep  3 17:13 .X11-unix
drwxr-x---    3 root     root           40 Dec 18 23:44 audit
drwx------    3 root     root           17 Dec 21 18:43 systemd-private-1666ccd83a2944ffb3e7552b167c86a1-chronyd.service-iJt0g4
-rw-------    1 root     root          254 Dec 14 19:29 yum_save_tx.2018-12-14.19-29.hJzbNo.yumtx
drwx------    3 root     root           20 Dec 14 23:58 adcli-krb5-byLGDl
drwx------    3 root     root           20 Dec 14 23:59 adcli-krb5-1jNweF
drwx------    3 root     root           20 Dec 15 00:02 adcli-krb5-E27qe6
drwx------    3 root     root           20 Dec 15 00:19 adcli-krb5-deCvix
-rw-------    1 root     root         1394 Dec 15 00:33 krb5cc_0
-rw-------    1 wbuser   domain users     1211 Dec 15 00:42 krb5cc_1416801120_Y4Yizn
-rw-------    1 root     root         1488 Dec 19 01:34 yum_save_tx.2018-12-19.01-34.w2dZjc.yumtx
drwx------    3 root     root           17 Dec 21 18:43 systemd-private-1666ccd83a2944ffb3e7552b167c86a1-cups.service-W1cJVN
* Connection #0 to host 192.168.5.6 left intact

Comment 2 Kamil Dudka 2018-12-21 14:55:25 UTC
I believe this is a duplicate of bug #1049921 -- libssh2 supports only a subset of pubkey authentication algorithms compared to OpenSSH.

Comment 3 Kamil Dudka 2019-01-21 12:22:59 UTC

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