def postOptions(self):
        """
        Set up conditional defaults and check for dependencies.

        If SSL is not available but an HTTPS server was configured, raise a
        L{UsageError} indicating that this is not possible.

        If no server port was supplied, select a default appropriate for the
        other options supplied.
        """
        if self['port'] is not None:
            self['ports'].append(self['port'])
        if self['https'] is not None:
            try:
                reflect.namedModule('OpenSSL.SSL')
            except ImportError:
                raise usage.UsageError("SSL support not installed")
            sslStrport = 'ssl:port={}:privateKey={}:certKey={}'.format(
                             self['https'],
                             self['privkey'],
                             self['certificate'],
                         )
            self['ports'].append(sslStrport)
        if len(self['ports']) == 0:
            if self['personal']:
                path = os.path.expanduser(
                    os.path.join('~', distrib.UserDirectory.userSocketName))
                self['ports'].append('unix:' + path)
            else:
                self['ports'].append('tcp:8080')

        Set up conditional defaults and check for dependencies.

        If SSL is not available but an HTTPS server was configured, raise a
        L{UsageError} indicating that this is not possible.

        If no server port was supplied, select a default appropriate for the
        other options supplied.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/tap.py