In real-world scenarios, rapidly and accurately identifying sources of fake news or disease outbreaks is crucial for public safety. Existing deep learning methods for source localization tasks entirely rely on supervised learning, which requires a large amount of labeled data. Recently, the emerging self-supervised learning (SSL) methods have significantly reduced the reliance on labeled data. Nevertheless, the investigation of SSL for source localization tasks remains unexplored. In this work, we are the first to adapt SSL for source localization tasks, specifically employing graph contrastive learning (GCL). Yet, directly applying GCL to source localization tasks faces two challenges: 1) existing data augmentation strategies are not well-suited for source localization tasks; 2) extremely low-dimensional node features potentially compromise the quality of learned node representations. To address these challenges, we introduce a Source Localization with Graph Contrastive Learning (SL-GCL) framework. Firstly, we propose a data augmentation strategy which exploits the inherent stochasticity of propagation. Secondly, we design a feature enrichment module to expand the feature dimensions. Finally, our experiments on six real-world networks demonstrate that SL-GCL outperforms state-of-the-art methods and exhibits remarkable transferability across different networks and propagation patterns.