code: def set_wsse(self, user=None, passwd=None):
          ''' Basic ws-security auth '''
          if user:
              self.user = user
          if passwd:
              self.passwd = passwd
  
          security = Security()
  
          if self.encrypt:
              token = UsernameDigestTokenDtDiff(self.user, self.passwd, dt_diff=self.dt_diff)
          else:
              token = UsernameToken(self.user, self.passwd)
              token.setnonce()
              token.setcreated()
  
          security.tokens.append(token)
          self.ws_client.set_options(wsse=securityf set_wsse(self, user=None, passwd=None):
          ''' Basic ws-security auth '''
          if user:
              self.user = user
          if passwd:
              self.passwd = passwd
  
          security = Security()
  
          if self.encrypt:
              token = UsernameDigestTokenDtDiff(self.user, self.passwd, dt_diff=self.dt_diff)
          else:
              token = UsernameToken(self.user, self.passwd)
              token.setnonce()
              token.setcreated()
  
          security.tokens.append(token)
          self.ws_client.set_options(wsse=security)
docs: Basic ws-security auth