ssl security

viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

hello, on my home.php i only include a specifique page :

Code: Select all

<?php
$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  

$response = file_get_contents("https://www.metairie-paulhac.fr/api/show/page/accueil", false, stream_context_create($arrContextOptions));

    $data = json_decode($response, true);
    echo $data['content'];


?>
but when i do this, i have this type of error :

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in /home/vivreune/www/metairie-paulhac/bl-themes/Metairie-V1/php/home.php on line 10

Warning: file_get_contents(): Failed to enable crypto in /home/vivreune/www/metairie-paulhac/bl-themes/Metairie-V1/php/home.php on line 10

Warning: file_get_contents(https://www.metairie-paulhac.fr/api/show/page/accueil): failed to open stream: operation failed in /home/vivreune/www/metairie-paulhac/bl-themes/Metairie-V1/php/home.php on line 10


what is wrong ??
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

What exatcly is the idea of this? Why including a page instead of using page?

By the way: Nice site!
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

because : i have Theme 1 with specific content of "page" and theme 2 with other, selectable after by my client, and called by a pre-title of key :

Code: Select all

        <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  

$response = file_get_contents("'http://www.metairie-paulhac.fr/api/show/all/pages/b547d5bed80a3435ba9fac89bcb34ba6", false, stream_context_create($arrContextOptions));

    $data = json_decode($response, true);
        foreach($data as $page) {
             if (strstr($page['key'],'v2-')){ 
                echo "<section>";
                echo $page['content'];
                echo "</section>";
            }
        }
        ?>
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

I try to reproduce it with your code. Or you can mail me a copy of the installation.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

email send, for an operationel version, i need to select :

admin/settings-advanced -> defauld home page : blog.

for my actuel model , to not interrupt the uptime version of my first version i actuel select : pages::accueil.
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

so ?
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

i would like to know if it's possible to create an option for multi-theme.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

viriisxp wrote:so ?
Sorry, I had to do some other things... I will test it now.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

viriisxp wrote:i would like to know if it's possible to create an option for multi-theme.
What do you mean with multi-theme? Different themes for diffferent pages?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Have you changed something? There is neither now an error at your installation nor at my testinstallation.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply