New libpacks for Windows with Qt5.12.6, OCC7.4

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
Kunda1
Posts: 8445
Joined: Thu Jan 05, 2017 9:03 pm

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by Kunda1 » Sat Feb 29, 2020 5:15 pm

I haven't tested it but I imagine? That if you signed up that you would be issued an API key that you can use to test. But it's a good point maybe there should be a self-test somewhere to be implemented
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
vejmarie
Posts: 665
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by vejmarie » Sat Feb 29, 2020 9:57 pm

apeltauer wrote:
Sat Feb 29, 2020 5:05 pm
Thanks for the link.
Are their some tests i can do to verify that the openssl and curl stuff works? Right now i just can tell that i compiles and the cloud wb starts. But even for that i dont know if their is any interaction at the start up...
Hi, sorry for the delay. I am living on a different timezone it looks like ;). So to test the software, either you do it from the docker image on your machine. Or you test it from the justyour.parts website, or an Amazon s3 account.

If you use justyour.parts, after your account has been created, you can go to the user environment to grab your credential.

Within FreeCAD, you need to create a new model, create a part (like a cube / cylinder or whatever). When this is done, go into the Python console and type the following commands.

import Cloud \
Cloud.cloudurl(u"https://justyour.parts") \
Cloud.cloudtcpport(u"443") \
Cloud.cloudaccesskey(u"YOUR ACCESS KEY") \ -> This is the TokenAuth you find into the web interface
Cloud.cloudsecretkey(u"YOUR PRIVATE KEY") \ -> This is the TokenSecret you find into the web interface
Cloud.cloudsave(u"YOUR MODEL NAME (lowercase only)") \ -> This is the file name equivallent, lower case only

When done, you can close your model. Create a new empty one and restore it

Cloud.cloudrestore(u"YOUR MODEL NAME (lowercase only)") \ -> This is the file name equivallent, lower case only

You will see it appearing also on the front page of the website !

Thanks for your efforts, keep me posted, look like we are progressing in the right direction.
Last edited by vejmarie on Sun Mar 01, 2020 12:54 am, edited 1 time in total.
User avatar
apeltauer
Posts: 317
Joined: Fri Aug 11, 2017 2:19 pm

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by apeltauer » Sat Feb 29, 2020 11:21 pm

Thanks for the info. Will try it tomorrow...
User avatar
apeltauer
Posts: 317
Joined: Fri Aug 11, 2017 2:19 pm

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by apeltauer » Sun Mar 01, 2020 10:04 am

Have tested your script. And i get the following error when trying to save some file to the cloud

Code: Select all

CloudApp.cpp line 737
void Cloud::CloudWriter::pushCloud(const char *FileName, const char *data, long size)
.....
CloudApp.cpp line 789
res = curl_easy_perform(curl);
                if(res != CURLE_OK)
                      fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));
                curl_easy_cleanup(curl);
curl_easy_perform returns

Code: Select all

CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
                                     wasn't verified fine */
User avatar
vejmarie
Posts: 665
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by vejmarie » Sun Mar 01, 2020 2:08 pm

apeltauer wrote:
Sun Mar 01, 2020 10:04 am
Have tested your script. And i get the following error when trying to save some file to the cloud

Code: Select all

CloudApp.cpp line 737
void Cloud::CloudWriter::pushCloud(const char *FileName, const char *data, long size)
.....
CloudApp.cpp line 789
res = curl_easy_perform(curl);
                if(res != CURLE_OK)
                      fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));
                curl_easy_cleanup(curl);
curl_easy_perform returns

Code: Select all

CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
                                     wasn't verified fine */
Weird :( Was it with the Container as a server or the justyour.parts server ? This error just mean that a certificate was not valid. justyour.parts server is using letsencrypt (I didn't purchased a certificate). I checked it and it is valid up to end of the month.
User avatar
Kunda1
Posts: 8445
Joined: Thu Jan 05, 2017 9:03 pm

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by Kunda1 » Sun Mar 01, 2020 2:17 pm

vejmarie wrote:
Sun Mar 01, 2020 2:08 pm
Weird :( Was it with the Container as a server or the justyour.parts server ? This error just mean that a certificate was not valid. justyour.parts server is using letsencrypt (I didn't purchased a certificate). I checked it and it is valid up to end of the month.
I don't know very much about SSL certificates...is it anything like PGP where the public keys queried against a server that documents if the keys are valid, revoked, updated etc... ?

Also, how long has the certificate been active (I know I could look, but I'm lazy :oops: )
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
apeltauer
Posts: 317
Joined: Fri Aug 11, 2017 2:19 pm

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by apeltauer » Sun Mar 01, 2020 2:31 pm

I have used your mentioned server....
User avatar
vejmarie
Posts: 665
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by vejmarie » Sun Mar 01, 2020 3:02 pm

apeltauer wrote:
Sun Mar 01, 2020 2:31 pm
I have used your mentioned server....
As to validate this is a certificate issue can you add within the Cloud code before the easy_perform call

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);

This will disable strict certificate check, and it shall go through. If it doesn't it means the issue will be somewhere else. If it does, we will have to figure out what are the differences between windows, linux and macos. I just retried on linux and MacOS and it works ;)
User avatar
vejmarie
Posts: 665
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by vejmarie » Sun Mar 01, 2020 3:08 pm

You can also try this command

curl https://justyour.parts

into a shell ? Does it report any certificate issue ? If not, it shall return the source code of the homepage

Can you print debug, the URL that the curl request is using when it fails within the PushCloud request ?
User avatar
apeltauer
Posts: 317
Joined: Fri Aug 11, 2017 2:19 pm

Re: New libpacks for Windows with Qt5.12.6, OCC7.4

Post by apeltauer » Sun Mar 01, 2020 3:26 pm

Update:
vejmarie wrote:
Sun Mar 01, 2020 3:02 pm

Code: Select all

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
If a add this line, i get a valid return code (CURLE_OK)


The url i get:

Code: Select all

chunk = Cloud::BuildHeaderAmzS3v2( strUrl.c_str(), this->TcpPort, this->AccessKey, RequestData);
strUrl.c_str() = justyour.parts
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests