With the continuous expansion and development of the Internet, the network traffic data has grown rapidly. Analyzing network traffic helps network managers plan, optimize, and monitor the network. At present, deep learning technology is widely used in traffic classification. This paper proposes a classification method of encrypted traffic based on the attention mechanism, which uses CNN to learn the classification features of encrypted traffic and then adopts the attention mechanism to adaptively obtain the importance of each feature, which effectively improves the accuracy of the model. Due to the black box characteristics of deep learning, the model lacks interpretability and cannot verify the reliability of the model. Therefore, this paper uses the chi-square test method combined with the SHAP interpretable method to verify the proposed model. The analysis of the experimental results proves that the model proposed in this paper is true and reliable.