Quantum optimal control theory allows us to design accurate quantum gates. We employ it to design high-fidelity two-bit gates for Josephson charge qubits in the presence of both leakage and noise. Our protocol considerably increases the fidelity of the gate and, more important, it is quite robust in the disruptive presence of 1/f noise. The improvement in the gate performances discussed in this work (errors approximately 10(-3)-10(-4) in realistic cases) allows us to cross the fault tolerance threshold.