def createGeoServerCatalog(service_url = "http://localhost:8080/geoserver/rest",
                           username="******",
                           password="******",
                           authid=None,
                           authtype=None,
                           disable_ssl_certificate_validation=False):
    # if not authid use basic auth
    if not authid or not authtype:
        catalog = GSCatalog(service_url, username, password, disable_ssl_certificate_validation)
    elif QGis.QGIS_VERSION_INT < 21200:
        # if autcfg, then get certs and ca and create a PKICatalog
        certfile, keyfile, cafile = pem.getPemPkiPaths(authid, authtype)

        # set connection
        catalog = PKICatalog(service_url, keyfile, certfile, cafile)

        # set authid parameter used by uri.py functions to manage
        # uri creation with pki credential
        catalog.authid = authid
    else:
        # For QGIS > 2.12, use the new AuthCatalog and QgsNetworkAccessManager
        settings = QtCore.QSettings()
        cache_time = int(settings.value("/GeoServer/Settings/GeoServer/AuthCatalogXMLCacheTime", 180, int))
        catalog = AuthCatalog(service_url, authid, cache_time)

    return CatalogWrapper(catalog)