mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
php: certificate was ignored
This commit is contained in:
@ -24,6 +24,8 @@ $GLOBALS['DOC_SERV_COMMAND_URL'] = "coauthoring/CommandService.ashx";
|
||||
$GLOBALS['DOC_SERV_JWT_SECRET'] = "";
|
||||
$GLOBALS['DOC_SERV_JWT_HEADER'] = "Authorization";
|
||||
|
||||
$GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] = TRUE;
|
||||
|
||||
$GLOBALS['EXAMPLE_URL'] = "";
|
||||
|
||||
$GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino";
|
||||
|
||||
@ -175,7 +175,9 @@ function SendRequestToConvertService($document_uri, $from_extension, $to_extensi
|
||||
);
|
||||
|
||||
if (substr($urlToConverter, 0, strlen("https")) === "https") {
|
||||
$opts['ssl'] = array( 'verify_peer' => FALSE );
|
||||
if($GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] === TRUE) {
|
||||
$opts['ssl'] = array( 'verify_peer' => FALSE, 'verify_peer_name' => FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
$context = stream_context_create($opts);
|
||||
|
||||
@ -255,7 +255,9 @@ function commandRequest($method, $key, $meta = null){
|
||||
));
|
||||
|
||||
if (substr($documentCommandUrl, 0, strlen("https")) === "https") {
|
||||
$opts['ssl'] = array( 'verify_peer' => FALSE );
|
||||
if($GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] === TRUE) {
|
||||
$opts['ssl'] = array( 'verify_peer' => FALSE, 'verify_peer_name' => FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
$context = stream_context_create($opts);
|
||||
|
||||
@ -39,6 +39,16 @@ $_trackerStatus = array(
|
||||
7 => 'CorruptedForceSave'
|
||||
);
|
||||
|
||||
// ignore self-signed certificate
|
||||
if($GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] === TRUE) {
|
||||
stream_context_set_default( [
|
||||
'ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
// check if type value exists
|
||||
if (isset($_GET["type"]) && !empty($_GET["type"])) {
|
||||
$response_array;
|
||||
|
||||
Reference in New Issue
Block a user