Skip to content

Instantly share code, notes, and snippets.

@alibo
Created November 10, 2018 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alibo/37c3bdaef78ba85b54df1d68c4b1f269 to your computer and use it in GitHub Desktop.
Save alibo/37c3bdaef78ba85b54df1d68c4b1f269 to your computer and use it in GitHub Desktop.
Getting Health information from FUCKING old ilo3 on g7
# issue: https://github.com/seveas/python-hpilo/issues/189
# thanks to @Shados: https://github.com/seveas/python-hpilo/issues/189#issuecomment-430893230
import re
import ssl
import json
import hpilo
ilo3_context = ssl.create_default_context()
# Start with the default cipher set
ciphers = ssl._DEFAULT_CIPHERS
# Remove any explit prohibition against 3DES
ciphers = re.sub(r":!3DES", "", ciphers)
# Add on DES-CBC3-SHA, as that apears to be the 'best' cipher suite supported
# by iLO3 v1.89
ciphers = ciphers + ":DES-CBC3-SHA"
# Use the modified cipher suite list
ilo3_context.set_ciphers(ciphers)
# Allow SSLv3
ilo3_context.options &= ~ssl.OP_NO_SSLv3
# Disable any attempt at verifying the cert
ilo3_context.check_hostname = False
ilo3_context.verify_mode = ssl.CERT_NONE
iloc = hpilo.Ilo(
"host", "user", "pass", timeout=5, ssl_context=ilo3_context
)
health = iloc.get_embedded_health()
print json.dumps(health, sort_keys=True,
indent=4, separators=(',', ': '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment