WordPress.org

Forums

Contact Form 7
Really simple captcha breaking SSL secure connection (13 posts)

  1. Oxocube
    Member
    Posted 1 year ago #

    Hello,

    I recently set up a form on a new website which uses an SSL certificate. The form is secure until I try and submit anything. I'm getting the following error once the submission is made:

    The page at 'https://XXXXX/contact/' was loaded over HTTPS, but displayed insecure content from 'http://XXXXX/wp-content/uploads/wpcf7_captcha/XXXXXXXXX.png': this content should also be loaded over HTTPS.

    Is there any way to fix this? I'd like the whole journey to be secure for the user.

    Thanks

    Ox

    http://wordpress.org/plugins/contact-form-7/

  2. igloobob
    Member
    Posted 1 year ago #

    I'm interested to hear about this too...

  3. Oxocube
    Member
    Posted 1 year ago #

    Add the following to functions.php in your theme ;)

    // Force SSL on form captcha
    define('WPCF7_CAPTCHA_TMP_URL','https://www.yourwebsite.co.uk/wp-content/uploads/wpcf7_captcha');

    Ox

  4. igloobob
    Member
    Posted 1 year ago #

    great thanks Ox, I'll get that added :)

  5. Oxocube
    Member
    Posted 1 year ago #

    No worries!

    Happy Friday.

  6. igloobob
    Member
    Posted 1 year ago #

    I just tried to implement this and it still loads on http, I've cleared cache, restarted browser etc and still no joy.

  7. Oxocube
    Member
    Posted 1 year ago #

    Can you confirm which plugin you're using to implement HTTPS?

    Cheers

    Ox

  8. igloobob
    Member
    Posted 1 year ago #

    Well I have my site urls set as https and also have wordpress https running, maybe I have a setting wrong in there as some pages are definitely not being forced into https.

  9. igloobob
    Member
    Posted 1 year ago #

    I always assumed if you had site urls fixed as https that would force all pages to https on its own?

  10. Oxocube
    Member
    Posted 1 year ago #

    Good to hear that you're using the WordPress HTTPS plugin.

    The problem may lie in you forcing SSL on every page. Within the plugin settings it says:

    Any page that is not secured via Force SSL or URL Filters will be redirected to HTTP.

    Try and un-tick this option and specify the form page in "URL filters" i.e. /contact.

    See if that does the trick.

    Ox

  11. igloobob
    Member
    Posted 1 year ago #

    Hi Ox,

    sorry for delay, I just checked and that setting is already unchecked. I will try and specify the page as you suggest.

    Thanks for the help

  12. Oxocube
    Member
    Posted 1 year ago #

    No worries buddy. If that doesn't work, I'm not sure what else you can do.

    Best of luck and have a good weekend!

    Ox

  13. jblakely
    Member
    Posted 1 year ago #

    I was able to get this working by implementing the fix described in this post.

    http://wordpress.org/support/topic/wp_content_url-based-defines-do-not-work-over-ssl-https

    Essentially, I edited wp-includes/default-constants.php and changed the wp_plugin_directory_constants function as follows:

    function wp_plugin_directory_constants( ) {
    /**
            if ( !defined('WP_CONTENT_URL') )
                    define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
    **/
            if ( !defined('WP_CONTENT_URL') )
                    define( 'WP_CONTENT_URL', site_url( 'wp-content') ); // full url - WP_CONTENT_DIR is define with https or http per connection

    Hopefully this will be helpful to others.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags