The bogusness is that sslfile really has nothing to do with the state in the context. It simply passes it on to the connection object. So the "fix" belong equally well in the caller of SSL.sslfile(), or in the create function for SSL.connection (probably slightly more motivated there).
Ideally, the problem should be fixed in the context object, but there was apparently a reason why it wasn't set there in the first place.
There are lots of odd things in the SSL code - it's very old. Without looking in to it I'd say it could just as well be a simple bug in context.pike, but maybe you have specific reasons to believe it's intentional?
If we should try to figure out a proper fix, it's good to begin with the specific case where this caused an error for you. What happened?