cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

How to install a cert and a key through Python SDK

F5_Digger
Altostratus
Altostratus

I am trying to install a cert and a key through Python SDK.

 

BIG-IP Version: 12.1.2

 

First.. I had no problem with uploading certs and keys to F5's /var/config/rest/downloads/ folder.

 

Now when I tried the following python code to install cert and key, I didn't see any error.

 

key = bitip.tm.sys.file.ssl_keys.ssl_key.create(name='test', partition='Common', sourcePath='file:/var/config/rest/downloads/test.key')

cert = bitip.tm.sys.file.ssl_certs.ssl_cert.create(name='test', partition='Common', sourcePath='file:/var/config/rest/downloads/test.crt')

 

However when I logged on BIG-IP device and clicked a cert or key to see their actual content, I couldn't see any content.

  • "No certificate" under certificate tab and an error message of "An error has occurred while trying to process your request." under Key tab.

 

Does any one know what is causing this problem?

Or is there any way I can troubleshoot this issue?

 

Thank you.

4 REPLIES 4

F5_Digger
Altostratus
Altostratus

I think I figured out what was the issue.

 

It seems the issue was relevant to the version of Python SDK I was using.

With my development, I was using the older version of Python SDK, ver. 2.3.2, where the latest version is 3.0.8.

It seems with the version of 2.3.2, exec_cmd() should be used.

Akash9920
Nimbostratus
Nimbostratus

Hey  , I have been facing the following error while creating the key : Text: '{"code":400,"message":"01070712:3: Certificate/Key has unknown format or security type (/Common/keynameAkash.key).","errorStack":[],"apiError":3}'.

 

do you have any suggestions?

 

 

 

need whole your lines of code to create a key..

Graha1m
Nimbostratus
Nimbostratus

Thanks for addressing this topic. I was looking for the information regarding the same. Keep sharing the info DQFanSurvey.