runtime/Stunnel.py
changeset 3884 34da877021d5
parent 3848 91da73c3df61
equal deleted inserted replaced
3883:a6e7dd8bac36 3884:34da877021d5
    48 def getPSKID(errorlog):
    48 def getPSKID(errorlog):
    49     if _PSKpath is not None:
    49     if _PSKpath is not None:
    50         if not os.path.exists(_PSKpath):
    50         if not os.path.exists(_PSKpath):
    51             errorlog(
    51             errorlog(
    52                 'Error: Pre-Shared-Key Secret in %s is missing!\n' % _PSKpath)
    52                 'Error: Pre-Shared-Key Secret in %s is missing!\n' % _PSKpath)
    53             return None
    53             return ("","")
    54         ID, _sep, PSK = open(_PSKpath).read().partition(':')
    54         ID, _sep, PSK = open(_PSKpath).read().partition(':')
    55         PSK = PSK.rstrip('\n\r')
    55         PSK = PSK.rstrip('\n\r')
    56         return (ID, PSK)
    56         return (ID, PSK)
    57     return None
    57     return ("","")