When Luke announces to Leia for the first time that they are siblings and the obvious emotions that come with learning their secret heritage and Luke leaves her and goes off to confront Vader, Han Solo comes along to check if she's alright.
Leia, instead of being honest and open with Han whom she loves, decides to keep the news a secret. As per this script:
HAN
Hey, what's goin' on?(Leia attempts to stifle her sobs and wipes her eyes.)
LEIA
Nothing. I - just want to be alone for a little while.HAN (angry)
Nothing? Come on, tell me. What's goin' on?She looks up at him, struggling to control herself.
LEIA
I...I can't tell you.HAN (loses his temper)
Did you tell Luke? Is that who you could tell?LEIA
I...HAN
Ahhh...(He starts to walk away, exasperated, then stops and walks back to her.)
HAN
I'm sorry.LEIA
Hold me.
I get that the frustration of having to keep a secret from someone you care about would be immense and troubling for her which the scene makes clear but as to my question: why did Leia not want to tell Han about this secret? And then, at the conclusion of the Battle of Endor, she finally tells him the truth about Luke and her anyway.