php: certificate was ignored

This commit is contained in:
Olga Larinova
2022-03-22 11:15:09 +03:00
parent 495f1cf49a
commit 642e145142
4 changed files with 18 additions and 2 deletions

View File

@ -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";

View File

@ -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);

View File

@ -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);

View File

@ -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;