Webwrite with SSL Certification

22 次查看(过去 30 天)
Simon Ward
Simon Ward 2023-10-13
评论: Joey 2024-10-10
Hi folks
I've used webwrite for a bunch of calls to various APIs, but I'm lost with this one...
I am connecting to a web service that requires SSL verification. I can connect with SOAPUi without trouble, so I'm hoping to roll out a similar solution in Matlab. I have a .pem file for both the cert and the key, however weboptions makes reference to CertificateFileName but not any accompanying key or password. It's also not clear what kind of certificates can be handled by Matlab for this purpose (.pem / .p12 etc).
I'm sure there is a Java workaround, but it would be great if this type of query could be handled in the Matlab environment.
Any hint would be really appreciated.
Thanks
Simon
  1 个评论
Joey
Joey 2024-10-10
Did you ever figure this out by chance? Simply combining the .crt and .pem into a single .pem and trying to pass it through CertificateFileName attitrubte in weboptions did not work for me

请先登录,再进行评论。

回答(1 个)

Dheeraj
Dheeraj 2023-10-26
Hi,
I understand you want to connect to a web service that require SSL certification. MATLAB “weboptions” object supports “.pem” certificates for “CertificateFileName” attribute however regarding the key for the SSL certificate, SSL has its public key already embedded into the certificate and the private key is in the web server of the page you would like to access, and the private key is used to decrypt the certificate to validate it.
So, you could use HTTPS built in classes in MATLAB to connect to a web service by creating and configuring the “weboptions” object.
You could go through the link below to get better insights about how to use HTTPS and “weboptions”.
Hope this helps!

标签

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by