#curl: tlsv1 alert unknown ca for self-signed error

1 messages · Page 1 of 1 (latest)

hearty crescent
#

Hello, I'm troubleshooting an issue where one api user works and another does not.

curl -ik --cert api_admin.pem --key api_admin.key https://192.168.7.200/api/cluster? fields=version

Also I can see successes within the audit log, but not the failures.

What causes this error:
curl: (56) OpenSSL SSL_read: error:0A000418:SSL routines::tlsv1 alert unknown ca, errno 0

I'm working with someone who created 2 admin level accounts at the cluster level where one works and the other gives this error.

Any tips on trouble shooting this would also be helpful.

Thank you in advance

vapid cosmos
spare stump
#

@vapid cosmos Although I do not want to believe it, I think error is a result of the version of Ontap not supporting it. I have several clusters and all but one are on 9.11.x whereas the one the curl command works on is 9.12.x. I may open a case to get confirmation.

#

import requests
import json
import pandas as pd
import urllib3 as ur
ur.disable_warnings()


key = '/path/to/rest_api_user.key'
crt = '/path/to/rest_api_user.pem'
clusters = ['clus01', 'clus02', 'clus03']


def test_run(clus, headers_inc: str):
    net_metrics_fields = (
        "metric.timestamp,metric.throughput.read,metric.throughput.write,metric.throughput.total"
    )
    net_metrics_url = (
        f"https://{clus}/api/network/ip/interfaces?fields={net_metrics_fields}"
        f"&return_records=true&return_timeout=15"
    )
    net_metrics_response = requests.get(net_metrics_url, headers=headers_inc, cert=(crt, key), verify=False)
    net_metrics_json_object = dict(net_metrics_response.json())
    net_metrics_s_data = json.dumps(net_metrics_json_object, indent=2)
    net_metrics_data = json.loads(net_metrics_s_data)
    net_metrics_records = net_metrics_data['records']
    net_metrics_df = pd.json_normalize(net_metrics_records)
    net_metrics_df['metric.timestamp'] = pd.to_datetime(net_metrics_df['metric.timestamp']).dt.strftime(
        '%Y-%m-%d %H:%M:%S')
    net_metrics_df['metric.cluster'] = cluster
    return net_metrics_df


if __name__ == "__main__":
    headers = {
        'content-type': "application/json",
        'accept': "application/json"
    }


for cluster in clusters:
    print(test_run(cluster, headers))```