Esempio n. 1
0
def SetSSLSvcVersion(sess, svcList, ssl3=1, tls1=1, tls11=1, tls12=1):
    ret = 0

    try:

        for s in svcList:
            if (ssl3 == 1):
                s.ssl3 = SSLSVC.Ssl3.ENABLED
            else:
                s.ssl3 = SSLSVC.Ssl3.DISABLED

            if (tls1 == 1):
                s.tls1 = SSLSVC.Tls1.ENABLED
            else:
                s.tls1 = SSLSVC.Tls1.DISABLED

            if (tls11 == 1):
                s.tls11 = SSLSVC.Tls11.ENABLED
            else:
                s.tls11 = SSLSVC.Tls11.DISABLED

            if (tls12 == 1):
                s.tls12 = SSLSVC.Tls12.ENABLED
            else:
                s.tls12 = SSLSVC.Tls12.DISABLED

        SSLSVC.update(sess, svcList)

    except NITROEXCEPTION.nitro_exception as e:
        print 'Nitro exception:::: {0}'.format(e.message)
        ret = e.errorcode

    return ret
Esempio n. 2
0
def AddSSLServices(harness):
    nameList = []
    for beS in harness.beServers:
        for i in range(6):
            s = NSSVC()
            s.ip = beS.ip
            s.port = 4443 + i
            s.name = 'sslsvc-' + str(harness.beID) + s.ip + '-' + str(s.port)
            nameList.append(s.name)
            s.servicetype = 'SSL'
            s.maxreq = 1
            harness.serviceList.append(s)

    NSSVC.add(harness.DUT.SESSION, harness.serviceList)
    harness.SSLServiceList = SSLSVC.get(harness.DUT.SESSION, nameList)

    # Without explicitly cleaning up these fields I cannot update
    # the service.

    for s in harness.SSLServiceList:
        s.dhfile = None
        s.cipherurl = None
        s.sslv2url = None
        s.clientcert = None
        s.commonname = None
        s.pushenctrigger = None
        s.dtlsprofilename = None
        s.sslprofile = None
        s.ersa = 'DISABLED'
        s.ersacount = 0

    SSLSVC.update(harness.DUT.SESSION, harness.SSLServiceList)
Esempio n. 3
0
def SetSSLSvcERsa(session, svc, ersa=1, ersacount=0, isupdate=1):
    ret = 0
    try:
        s = SSLSVC()
        s.servicename = svc
        if (ersa == 1):
            s.ersa = SSLSVC.Ersa.ENABLED
        else:
            s.ersadh = SSLSVC.Ersa.DISABLED
        s.ersacount = ersacount

        if (isupdate == 1):
            SSLSVC.update(session, s)

    except NITROEXCEPTION.nitro_exception as e:
        print 'Nitro exception:::: {0}'.format(e.message)
        ret = e.errorcode
    return ret
Esempio n. 4
0
def Test10():
    namelist = []
    slist = []
    sess = Login('10.102.28.201')

    s = NSSVC()
    s.ip = '10.102.28.61'
    s.port = 5551
    s.name = 'ashoke-1'
    s.servicetype = 'SSL'
    slist.append(s)

    s = NSSVC()
    s.ip = '10.102.28.61'
    s.port = 5552
    s.name = 'ashoke-2'
    s.servicetype = 'SSL'
    slist.append(s)

    NSSVC.add(sess, slist)

    for s in slist:
        namelist.append(s.name)

    sslsvclist = SSLSVC.get(sess, namelist)
    for s in sslsvclist:
        print s.servicename
        s.ssl3 = 'DISABLED'
        s.dhfile = None
        s.cipherurl = None
        s.sslv2url = None
        s.clientcert = None
        s.commonname = None
        s.pushenctrigger = None
        s.dtlsprofilename = None
        s.sslprofile = None
        s.ersa = 'DISABLED'
        s.ersacount = 0

    try:
        SSLSVC.update(sess, sslsvclist)
        #SSLSVC.update(sess,sslsvclist[1])
    except NITROEXCEPTION.nitro_exception as e:
        print e.message
Esempio n. 5
0
def SetSSLSvcDH(session, svc, dhfile='dh2048', dh=1, dhcount=0, isupdate=1):
    ret = 0
    try:
        s = SSLSVC()
        s.servicename = svc
        if (dh == 1):
            s.dh = SSLSVC.Dh.ENABLED
        else:
            s.dh = SSLSVC.Dh.DISABLED
        s.dhcount = dhcount
        s.dhfile = dhfile

        if (isupdate == 1):
            SSLSVC.update(session, s)

    except NITROEXCEPTION.nitro_exception as e:
        print 'Nitro exception:::: {0}'.format(e.message)
        ret = e.errorcode
    return ret
Esempio n. 6
0
def SetSSLSvcMisc(session,
                  svc,
                  snienable=0,
                  serverauth=0,
                  commonname=None,
                  sessreuse=0,
                  sesstimeout=120,
                  isupdate=1):
    ret = 0
    try:
        if not isinstance(svc, SSLSVC):
            s = SSLSVC()
            s.servicename = svc
        else:
            s = svc

        if (snienable == 1):
            s.snienable = SSLSVC.Snienable.ENABLED
        else:
            s.snienable = SSLSVC.Snienable.DISABLED

        if (serverauth == 1):
            s.serverauth = SSLSVC.Serverauth.ENABLED
        else:
            s.serverauth = SSLSVC.Serverauth.DISABLED

        if (sessreuse == 1):
            s.sessreuse = SSLSVC.Sessreuse.ENABLED
            s.sesstimeout = sesstimeout
        else:
            s.sessreuse = SSLSVC.Sessreuse.DISABLED

        s.commonname = commonname

        if (isupdate == 1):
            SSLSVC.update(session, s)

    except NITROEXCEPTION.nitro_exception as e:
        print 'Nitro exception:::: {0}'.format(e.message)
        ret = e.errorcode
    return ret