code4recovery / pdf

Meeting schedule PDF generation service
https://pdf.code4recovery.org
MIT License
3 stars 2 forks source link

Error on dev site - SSL certificate problem #43

Closed onemooresam closed 1 year ago

onemooresam commented 1 year ago

Error: Could not fetch data. Please check the address. Received the following message: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://averym8.sg-host.com/wp-admin/admin-ajax.php?action=meetings&nonce=f8def5b229

Updating atlantaaa.org's site on a dev site (https://averym8.sg-host.com/) to migrate them from the customized TSML plugin they stopped updating in Spring 2020. A printed meeting list is desired. Can this be made to work on the dev site?

anchovie91471 commented 1 year ago

Hey @onemooresam, I'm not seeing any errors in our logs on pdf.code4recovery.org.

Did you click the button on the Import/Export page (shown here)?

Screen Shot 2023-06-18 at 11 02 21 AM

As long as you have a feed that's available from the dev site, you can print a list. Do you have a feed setup on the settings page of 12 Step Meeting List (on dev)?

onemooresam commented 1 year ago

Hi there,

I just tried again. On the dev site, in Meetings>>Import & Export, I click the "Generate PDF" button. That opens a new window at https://pdf.code4recovery.org/?json=https%3A%2F%2Faverym8.sg-host.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dmeetings%26nonce%3D9e9de4f759. Accepting the defaults and clicking the Generate button yields, "Could not fetch data. Please check the address. Received the following message: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://averym8.sg-host.com/wp-admin/admin-ajax.php?action=meetings&nonce=9e9de4f759" The feed is set to public. Feed URL: https://averym8.sg-host.com/wp-admin/admin-ajax.php?action=meetings

dev site C4R PDF page

Dev Site Meeting Feed Settings

joshreisner commented 1 year ago

thanks sam, looks like the SSL certificate is "not trusted in all browsers" https://www.sslshopper.com/ssl-checker.html#hostname=https://averym8.sg-host.com/

@anchovie91471 i would try disabling ssl verification on our end:

on this line: https://github.com/code4recovery/pdf/blob/main/app/Http/Controllers/Controller.php#LL167C25-L167C34

add withOptions: https://laravel.com/docs/10.x/http-client#guzzle-options

verify => false https://docs.guzzlephp.org/en/stable/request-options.html#verify

Http::withOptions(['verify' => false])->get(

i don't think we're too worried about man-in-the-middle attacks here 😉

joshreisner commented 1 year ago

hi sam, you should be able to use the PDF generator with your feed now

onemooresam commented 1 year ago

Worked perfectly! Thank you so much!

On Sun, Jul 2, 2023 at 11:58 AM Josh Reisner @.***> wrote:

hi sam, you should be able to use the PDF generator with your feed now

— Reply to this email directly, view it on GitHub https://github.com/code4recovery/pdf/issues/43#issuecomment-1616774459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEJH7I2PZOHQJ3OZOXRYM3LXOHAHDANCNFSM6AAAAAAZJYFQDY . You are receiving this because you were mentioned.Message ID: @.***>