To the OP, either way he is shy and has social difficulties, what difference would knowing it was AS over shyness/social anxiety make? Would you think of him or treat him any differently? Personally I think if he didn't tell you himself then he probably either a)doesn't want you to know or b) isn't ready to tell you. Many people view a diagnosis as private, asking out of the blue can seem nosy and also that you are implying he made some sort of social mistake (and even if he did that can still be hurtful).
If you really want to know I'd recommend casually bringing aspergers into the conversation, maybe saying something like, "I just read this book, it's about a person with AS," and briefly discussing it, if he's diagnosed with AS and wants to share with you he probably will, if he doesn't you could probably take that as an indication he doesn't want to share or doesn't have it.