Re: [mapserver-users] PostgreSQL authentication method.
${PG_LIB_PATH} /usr/lib /usr/local/lib /usr/lib/postgresql /usr/lib64 /usr/local/lib64 /usr/lib64/postgresql $ENV{ProgramFiles}/PostgreSQL/*/lib/ms $ENV{SystemDrive}/PostgreSQL/*/lib/ms ) To make it work, I changed the IF block for PG_CONFIG as follows. What this does is only search and use the library and include paths that are set by executing the pg_config command. If pg_config is not found, then it searches the default locations. It seems to me that if pg_config is set my by environment, then it should use my pg_config to set the library and include paths. Can anyone comment on whether this makes sense or not? if (PG_CONFIG) exec_program( ${PG_CONFIG} ARGS "--includedir" OUTPUT_VARIABLE PG_INC_PATH ) exec_program( ${PG_CONFIG} ARGS "--libdir" OUTPUT_VARIABLE PG_LIB_PATH ) find_path(POSTGRESQL_INCLUDE_DIR libpq-fe.h PATHS ${PG_INC_PATH} NO_DEFAULT_PATH ) find_library(POSTGRESQL_LIBRARY NAMES pq libpq PATHS ${PG_LIB_PATH} NO_DEFAULT_PATH ) else() message(WARNING "pg_config not found, will try some defaults") find_path(POSTGRESQL_INCLUDE_DIR libpq-fe.h /usr/include/server /usr/include/postgresql /usr/include/pgsql/server /usr/local/include/pgsql/server /usr/include/postgresql/server /usr/include/postgresql/*/server /usr/local/include/postgresql/server /usr/local/include/postgresql/*/server $ENV{ProgramFiles}/PostgreSQL/*/include/server $ENV{SystemDrive}/PostgreSQL/*/include/server ) find_library(POSTGRESQL_LIBRARY NAMES pq libpq PATHS /usr/lib /usr/local/lib /usr/lib/postgresql /usr/lib64 /usr/local/lib64 /usr/lib64/postgresql $ENV{ProgramFiles}/PostgreSQL/*/lib/ms $ENV{SystemDrive}/PostgreSQL/*/lib/ms ) endif() By changing FindPostgreSQL.cmake file I get the following results. PG_CONFIG is set to /usr/local/bin/pg_config PG_INC_PATH is set to /usr/local/include PG_LIB_PATH is set to /usr/local/lib POSTGRESQL_INCLUDE_DIR is set to /usr/local/include POSTGRESQL_LIBRARY is set to /usr/local/lib/libpq.dylib And cmake output shows the libpq that was installed from homebrew. -- * POSTGIS: /usr/local/lib/libpq.dylib After this, the compile works fine and scram-sha-256 authentication works as expected. Thanks, Paul From: Carlos Ruiz Date: Thursday, February 18, 2021 at 5:53 PM To: "Moen, Paul T." , Steve Lime Cc: "mapserver-users@lists.osgeo.org" Subject: Re: [mapserver-users] PostgreSQL authentication method. On Thursday, February 18, 2021, 3:49:48 PM CST, Steve Lime wrote: I wonder if that's more a function of the PostgreSQL client library version/capabilities. Do you know what MapServer is compiled against? You might try connecting to your database with psql as another test of the client lib. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PostgreSQL authentication method.
The key is the message "authentication method 10 not supported". It seems that PostgreSQL client library's version is older and does not support that encryption method. Versions 10 and later supports it. On Thursday, February 18, 2021, 3:49:48 PM CST, Steve Lime wrote: I wonder if that's more a function of the PostgreSQL client library version/capabilities. Do you know what MapServer is compiled against? You might try connecting to your database with psql as another test of the client lib. On Thu, Feb 18, 2021 at 2:25 PM Moen, Paul T. wrote: I recently tried a Mapserver layer connected to a PostgreSQL 13.2 database that had password_encryption = scram-sha-256. I was unsuccessful in getting it to work until I switched it to md5 and reset the passwords. The following error was logged and the interesting part seems to be (authentication method 10 not supported). [Thu Feb 18 13:57:02.652879 2021] [php7:warn] [pid 16668] [client 192.168.100.4:57341] PHP Warning: mapObj::drawQuery(): [MapServer Error]: msPostGISLayerOpen(): Database connection failed. Check server logs for more details.Is the database running? Is it allowing connections? Does the specified user exist? Is the password valid? Is the database on the standard port?\n in /Volumes/Data/WebServer/newswc/php/drawmappm.php on line 243, referer: http://stagmapservice.swc.nd.gov/ Database connection failed (authentication method 10 not supported ) with connect string 'user=dauser password=** dbname=swc host=dadatabase.blah.blah.blah port=5432' Is the database running? Is it allowing connections? Does the specified user exist? Is the password valid? Is the database on the standard port? in msPostGISLayerOpen()msPostGISLayerOpen(): Query error. Database connection failed. Check server logs for more details.Is the database running? Is it allowing connections? Does the specified user exist? Is the password valid? Is the database on the standard port? msDrawMap(): Image handling error. Failed to draw layer named 'Countries - Natl Atlas'. Is this an issue with MapServer? If so, will scram-sha-256 authentication be supported by Mapserver? Thanks, Paul MapServer version 7.6.2 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PostgreSQL authentication method.
I wonder if that's more a function of the PostgreSQL client library version/capabilities. Do you know what MapServer is compiled against? You might try connecting to your database with psql as another test of the client lib. On Thu, Feb 18, 2021 at 2:25 PM Moen, Paul T. wrote: > I recently tried a Mapserver layer connected to a PostgreSQL 13.2 database > that had password_encryption = scram-sha-256. I was unsuccessful in > getting it to work until I switched it to md5 and reset the passwords. The > following error was logged and the interesting part seems to be > (authentication method 10 not supported). > > [Thu Feb 18 13:57:02.652879 2021] [php7:warn] [pid 16668] [client > 192.168.100.4:57341] PHP Warning: mapObj::drawQuery(): [MapServer > Error]: msPostGISLayerOpen(): Database connection failed. Check server logs > for more details.Is the database running? Is it allowing connections? Does > the specified user exist? Is the password valid? Is the database on the > standard port?\n in /Volumes/Data/WebServer/newswc/php/drawmappm.php on > line 243, referer: http://stagmapservice.swc.nd.gov/ > Database connection failed (authentication method 10 not supported > ) with connect string 'user=dauser password=** dbname=swc > host=dadatabase.blah.blah.blah port=5432' > Is the database running? Is it allowing connections? Does the specified > user exist? Is the password valid? Is the database on the standard port? in > msPostGISLayerOpen()msPostGISLayerOpen(): Query error. Database connection > failed. Check server logs for more details.Is the database running? Is it > allowing connections? Does the specified user exist? Is the password valid? > Is the database on the standard port? > msDrawMap(): Image handling error. Failed to draw layer named 'Countries - > Natl Atlas'. > > Is this an issue with MapServer? If so, will scram-sha-256 authentication > be supported by Mapserver? > > Thanks, > > Paul > > MapServer version 7.6.2 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ > SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV > SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER > SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER > SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG > INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] PostgreSQL authentication method.
I recently tried a Mapserver layer connected to a PostgreSQL 13.2 database that had password_encryption = scram-sha-256. I was unsuccessful in getting it to work until I switched it to md5 and reset the passwords. The following error was logged and the interesting part seems to be (authentication method 10 not supported). [Thu Feb 18 13:57:02.652879 2021] [php7:warn] [pid 16668] [client 192.168.100.4:57341] PHP Warning: mapObj::drawQuery(): [MapServer Error]: msPostGISLayerOpen(): Database connection failed. Check server logs for more details.Is the database running? Is it allowing connections? Does the specified user exist? Is the password valid? Is the database on the standard port?\n in /Volumes/Data/WebServer/newswc/php/drawmappm.php on line 243, referer: http://stagmapservice.swc.nd.gov/ Database connection failed (authentication method 10 not supported ) with connect string 'user=dauser password=** dbname=swc host=dadatabase.blah.blah.blah port=5432' Is the database running? Is it allowing connections? Does the specified user exist? Is the password valid? Is the database on the standard port? in msPostGISLayerOpen()msPostGISLayerOpen(): Query error. Database connection failed. Check server logs for more details.Is the database running? Is it allowing connections? Does the specified user exist? Is the password valid? Is the database on the standard port? msDrawMap(): Image handling error. Failed to draw layer named 'Countries - Natl Atlas'. Is this an issue with MapServer? If so, will scram-sha-256 authentication be supported by Mapserver? Thanks, Paul MapServer version 7.6.2 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users