PuRestJson
PuRestJson copied to clipboard
Error 77: Problem with the SSL CA cert (path? access rights?)
Running the rest-help.pd patch and trying any GET methods with either oath or rest results in the following error:
Error while performing request: Problem with the SSL CA cert (path? access rights?)
This issue is related to #59
pd-0.52-2 MacOS Montery 12.4 PuRest v1.4.3
I tried the "rest-help.pd" example on Monterey and it worked with PuRest v1.4.3 from Deken, pd-0.52-2 (only problem: [print] log crashed because weird data coming, so I used [text define] and [text get] to store the data in example).
But the last v2.0.0 build from Circle CI triggered the "SSL CA cert" error file: 47_2022-05-04_purest_jsonv2.0.0-alpha.dek
On Monterey 12.6.1, in rest-help.pd, [sslcheck 0( removes "SSL CA cert" error, but [GET https://jsonplaceholder.typicode.com/posts( crashes PureData because [print] couldn't handle data output from [rest] object, I've tried to use a text buffer to store data, but PureData crashes when I clic on [text define data]. The download file method works good with sending [sslcheck 0( and [file /tmp/test.json( messages though.
Thanks @patricecolet
Thanks to Patrice the crash should be fixed with the current builds on https://cloud.residuum.org/index.php/s/380C60JAabnO7jk dex files are just zip files with a different file ending.
[sslcheck 0( will disable checking the certificates, so this is not a save option.
Currently only Mac OS X needs the cacert.pem file, as both Linux and Windows use the CA certificates from the OS. The documentation for libcurl states that this is not needed if libcurl is built with Secure Transport (https://curl.se/libcurl/c/CURLOPT_CAINFO.html), but I am unsure about the version that is shipped with homebrew.
@patricecolet : Thank you for your help. Could you please test a build with Line 43 from purest_json.h removed? This line adds the cacert.pem file from the local path (https://github.com/residuum/PuRestJson/blob/master/src/purest_json.h#L43). If this will resolve the issue, I will remove the local certificate file completely from the project.
I've tried Darwin arm64 build from https://cloud.residuum.org/index.php/s/380C60JAabnO7jk
I've downloaded the .dek file build 136 and installed with PureData's deken. When I open the help patch, the macos authorize system is getting a bit crazy, after authorizing the binary files used by rest-help.pd the crash is still there.
I've pulled the updated sources, and commented line 43 from purest_son.h
The build happens without errors after fixing Makefile.pdlibbuilder Line 521:
cpp.flags := -DUNIX -DMACOSX -I /opt/homebrew/include
and Line 524:
c.ldlibs := -lc -L/opt/homebrew/lib
I had to do some magicks I honnestly don't understand with sourcetree, my git client, for retrieving the content of pd-lib-builder. Otherwise this folder remains empty after a git clone
the install process ends up with this:
install: cacert.pem: No such file or directory install: *.dylib: No such file or directory
Anyway there is a lot of improvements, nested objects works good, [rest] doesn't need anymore [sslcheck 0( for requests, but it still crashes on [GET https://jsonplaceholder.typicode.com/posts( request.
This post has been edited to mention that I've also tried build 153, same thing happens.
I had to do some magicks I honnestly don't understand with sourcetree, my git client, for retrieving > the content of pd-lib-builder. Otherwise this folder remains empty after a git clone
It has been resolved with: git clone --recursive
Does the latest version work without setting [sslcheck 0(. Note, that the jsonplaceholder request will still have the same errors, I will tackle that later.
Does the latest version work without setting [sslcheck 0(.
I tried build 194 from link
But like I said before my OS policy doesn't like those binaries
json-decode.pd_darwin' not valid for use in process: library load disallowed by system policy) json-encode.pd_darwin' not valid for use in process: library load disallowed by system policy) urlparams.pd_darwin' not valid for use in process: library load disallowed by system policy) oauth.pd_darwin, 0x000A): symbol not found in flat namespace (_oauth_sign_url2)
Meanwhile with a fresh git pull, and build there is no error at all :)
There is no need for [sslcheck 0( anymore.
The Mac OS policy with arbitrary binaries is a known problem, and there are people discussing a solution, but no definite solution has been found so far.
https://lists.puredata.info/pipermail/pd-list/2022-10/131549.html
Should be fixed with 2.0.0