Forum Discussion
Uploading SKCS 12 File to F5 Device
- Oct 17, 2024
to update device certs ---> Changing the BIG-IP system device certificate using the Configuration utility (f5.com)
if updating the certificate system bundle :
make sure you make a backup as any corruption on this file can impact system communications
vi /config/ssl/ssl.crt/ca-bundle.crt
Have you tried to use Content-Range: bytes 0-11615/total_file_size in your python script ? Is there any encoding happening before the upload? If so double check the encoded length matches what your using in the headers
chunk_size = 512 * 1024 # 512 KB chunk size for uploading
def upload_file(file_data, file_name):
total_size = len(file_data)
url = f'https://{f5_ip}/mgmt/shared/file-transfer/uploads/{file_name}'
start = 0
response = None
while start < total_size:
end = min(start + chunk_size, total_size)
file_slice = file_data[start:end]
content_range = f"{start}-{end - 1}/{total_size}"
print("Content Range: ", content_range)
upload_headers['Content-Range'] = content_range
response = requests.post(url, headers=upload_headers, data=file_slice, verify=False)
if response.status_code != 200:
print(f"Error during upload: {response.text}")
break
start = end
print("Response: ", response.text)
this is currently what I have been using, should I change it? I wanted it to be able to upload any type of file
- cheluscoOct 17, 2024Altostratus
Also, once uploaded, how would I upload the PKCS 12 file to the devices cert list?
- Jeffrey_GranierOct 17, 2024Employee
You can try to specify the sizes in the content header considering your error returning provided values back.
content_range = 0-7611
also have you tried to specify the exact chunk value?
chunk_size = 7611 # Define the size of the chunks
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com