Resolves string names to integer constant in ssl configuration.

def _update_ssl_config(opts):
    '''
    Resolves string names to integer constant in ssl configuration.
    '''
    if opts['ssl'] in (None, False):
        opts['ssl'] = None
        return
    if opts['ssl'] is True:
        opts['ssl'] = {}
        return
    import ssl
    for key, prefix in (('cert_reqs', 'CERT_'),
                        ('ssl_version', 'PROTOCOL_')):
        val = opts['ssl'].get(key)
        if val is None:
            continue
        if not isinstance(val, six.string_types) or not val.startswith(prefix) or not hasattr(ssl, val):
            message = 'SSL option \'{0}\' must be set to one of the following values: \'{1}\'.' \
                    .format(key, '\', \''.join([val for val in dir(ssl) if val.startswith(prefix)]))
            log.error(message)
            raise salt.exceptions.SaltConfigurationError(message)
        opts['ssl'][key] = getattr(ssl, val)