When I use file_create_url it return url with http instead of https.
$desimg = file_create_url($node->field_image->entity->getFileUri());
Due to which i m getting warning like below
Mixed Content: The page at 'https://www.example.com/' was loaded over HTTPS, but requested an insecure image 'http://www.example.com/sites/default/files/test/test_M_01.jpg'. This content should also be served over HTTPS.
I'm missing something?