You should read the codex on Administration Over SSL and also shouldn’t edit the core wordpress files as it isn’t advised and your edits get overwritten on update.
You should define FORCE_SSL_ADMIN in your wp-config.php
define('FORCE_SSL_ADMIN', true);