Copy link to clipboard
Copied
HI ,
I'm new to SSL's and scripting.
I have written code to access http site and it is working.Below is the code.The script is failing when i try to access https application.
Can some one please help me .
below is the code.
var request = [];
request.push('POST', ' ', path, ' ', "HTTP/1.1\n");
request.push('Authorization:', 'Basic d2NhZG1pbjp3Y2FkbWlu==', '\n');
request.push('Host: ', host, "\r\n");
request.push('User-Agent: ', USER_AGENT, "");
//request.push('Connection: ', 'close', "\n");
request.push('Pragma: ', "no-cache", "\r\n");
request.push('Accept: ', "*/*", "\r\n");
request.push('Accept-Charset: ', "UTF-8", "\r\n");
request.push('Accept-Language: ', "en-US", "\r\n");
request.push('Content-Language: ', "en-US", "\r\n");
request.push('content-location: ', file.name, "\r\n");
//request.push('Content-Length: ', fileContents.length, "\r\n");
request.push('Content-Length: ', content.length, "\r\n");
request.push('Content-Type: ', 'multipart/form-data;boundary=', boundary, "\r\n");
request.push('\n');
request.push(content);
alert('request--->'+request);
// 5. Upload
var socket = new Socket;
socket.open(host+':80', 'BINARY');
for (var i = 0; i < request.length; ++ i) {
socket.write(request);
}
Copy link to clipboard
Copied
Unfortunately, Illustrator not supported Socket Object.
Ten
Copy link to clipboard
Copied
HI Ten,
Thanks for responding.
I'm using bridge and able to access http URL.the moment i access https it is breaking.
Do we have any work around or solution to access https URL.
Please help .
Regards.
Venkat
Copy link to clipboard
Copied
You need to implement TLS, Can find some solutions in GitHub.
However, We can use Adobe Extension SDK, Provide to make Extensions HTML5+NODE.js with Extendscript. NODE.js includes HTTPS protocol and easy to use. You can reference below:
Adobe-CEP/CEP-Resources · GitHub
Ten
Copy link to clipboard
Copied
Hi Ten,
is there any other option in illustrator instead of socket?
Copy link to clipboard
Copied
If you are familiar with C++, You can make HTTP Client External Object.
Please refer basicexternalobject project under the ./Adobe EXtendScript Toolkit CC/SDK/Samples/cpp/
Copy link to clipboard
Copied
Hi Ten,
Thanks for your time.
Sorry I'm confused totally .Let me rephrase the issue im facing.
I'm executing the script from AI.The script starts Bridge and connects to the external application(Once connected takes input as AI file and send request request in Socket object) .
This is working for http .failing when i try to access https.
Is there any way to implement https access in the script it self without modifying in external Server.Seems Adobe Extension SDK with this ,i have to re-Implement totally.
Please suggest I need something which can be executed from AI .
Regards,Venkat
Copy link to clipboard
Copied
We can write HTTPS Socket logic with Extendscript and Bridgetalk, Need to impliment "Handshake encripted stream" > "Build HTTP headder" > "encrypt with private key" > "pass encrypted headder" > "build body and encrypt"...
Its very bother for me. I often to use Adobe Extension SDK like previouse case.
However, you can read as reference HTTP over TLS:
http://www.infoq.com/articles/HTTPS-Connection-Jeff-Mose
In AdobeExtensionSDK, We can impliment HTTPS process with node.js and NPM packages, and main logic(working with Illustrator Objects) still Extendscript. You only need to rewrite socket manipuration and its very easy in NODE.js.
Ten
Copy link to clipboard
Copied
Hi Venkat,
do you think a HTML panel would fit your needs? You need to send event from extendscipt and handle it in the panel. There it would be jast ajax to a https server