Forum Discussion
andy_12_5042
Nimbostratus
Dec 29, 2010pycontrol to set certificate/key for ssl profile
Sorry for the triple post last question...... My browser appeared to timeout so I thought submission was failing..
I have noticed that it is not possible to create a new profile and set the ...
L4L7_53191
Nimbostratus
Dec 29, 2010I have a feeling I'm missing what you're trying to do Andy. Anyhow - here's an example of create() with set_passphrase():
In [78]: cert_ob = ssl.typefactory.create('LocalLB.ProfileString')
In [79]: key_ob = ssl.typefactory.create('LocalLB.ProfileString')
In [80]: cert_ob.value = 'default.crt'
In [81]: key_ob.value = 'default.key'
In [82]: cert_ob.default_flag,key_ob.default_flag = True,True
In [83]: ssl.create(profile_names = ['via-pycontrol'], keys = [key_ob], certs=[cert_ob])
Now set the passphrase on our new profile.
In [84]: phrase = ssl.typefactory.create('LocalLB.ProfileString')
In [85]: phrase.default_flag = False
In [86]: phrase.value = 'L4L7'
In [87]: ssl.set_passphrase(['via-pycontrol'],passphrases=[phrase])
Confirm we have a profile, and a passphrase:
In [88]: ssl.get_passphrase(['via-pycontrol'])
Out[88]:
[(LocalLB.ProfileString){
value = "$M$61$5qbNv9PnBOcvfUIwFnkyWQ=="
default_flag = False
}]
Is this what you are after? For me, the key piece to set the passphrase was to set the default_flag to False. Using True wouldn't allow me to set the value.
-Matt
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects