You already know the answer. Write what you know. Before you throw up your hands and huff that you weren't born at the dawn of time or haven't yet had the chance to explore the distant reaches of the universe, let me assure you you have. You just haven't realized it yet. Let's deal with the most obvious first.
Technical knowledge is pretty much self-explanatory.
If I tell you I'm a former Naval officer, it probably wouldn't surprise you to learn my debut book was a military romantic suspense. FOR HIS EYES ONLY, was a military romantic suspense. You bet I did. Admittedly, it took a slap upside the head from my writing mentor to nudge me down that path. But once I'd started stumbling along, you can be darn sure I made certain the editor I submitted to knew I was military.