def _get_ssl_pymongo_options(self, args):
        opts = {}
        if not self.ssl_server_args:
            return opts

        for parser in [self.ssl_server_args]:
            for action in parser._group_actions:
                name = action.dest
                value = args.get(name)
                if value:
                    opts['ssl'] = True
                    opts['ssl_cert_reqs'] = ssl.CERT_NONE
        for parser in self.ssl_args, self.ssl_client_args:
            for action in parser._group_actions:
                name = action.dest
                value = args.get(name)
                if value:
                    opts['ssl'] = True

                    if name == 'sslClientCertificate':
                        opts['ssl_certfile'] = value
                    elif name == 'sslClientPEMKeyFile':
                        opts['ssl_keyfile'] = value
                    elif name == 'sslClientPEMKeyPassword':
                        opts['ssl_pem_passphrase'] = value
                    elif name == 'sslAllowInvalidCertificates':
                        opts['ssl_cert_reqs'] = ssl.CERT_OPTIONAL
                    elif name == 'sslAllowInvalidHostnames':
                        opts['ssl_match_hostname'] = False
                    elif name == 'sslCAFile':
                        opts['ssl_ca_certs'] = value
                    elif name == 'sslCRLFile':
                        opts['ssl_crlfile'] = value

        return opts